第一次模仿制作百度页面,感觉有一点难,相似度也不是很高 哈哈哈哈
HTML代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title>百度一下,你就知道</title>
<!-- 链接式 -->
<link rel="stylesheet" href="./css/百度.css">
</head>
<body>
<div class="top">
<a href="#" target="_blank" class="lf">新闻</a>
<a href="#" target="_blank" class="lf">hao123</a>
<a href="#" target="_blank" class="lf">地图</a>
<a href="#" target="_blank" class="lf">直播</a>
<a href="#" target="_blank" class="lf">贴吧</a>
<a href="#" target="_blank" class="lf">学术</a>
<a href="#" target="_blank" class="lf">更多</a>
<a href="#" target="_blank" class="lf"><span class="sz">设置</span></a>
<a href="#" target="_blank" ><span class="dl">登录</span></a>
</div>
<div align="center"><img src="img/baidu.jpg" width="300" class="baidu"></div>
<form action="https://www.baidu.com/" method="get"><div align="center" ><input type="text" class="frame"><input type="submit" class="click"
value="百度一下"></div></form>
</body>
</html>
CSS代码:
.top {
font-family: "microsoft yahei";
font-size: 13px;
line-height: 40px;
}
a {
/* 将超链接标签取消下划线 */
text-decoration: none;
color: black;
}
/*设置*/
.sz {
position: absolute;
right: 110px;
}
/*登录*/
.dl {
position: absolute;
right: 40px;
background-color: #3388FF;
width: 50px;
text-align: center;
color: #FFFFFF;
}
.frame {
width: 540px;
height: 36px;
margin-top: 20px;
font-size: 20px;
border-width: 1px;
/* 背景图片*/
background-image: url(../img/QQ图片20210603092423.png);
background-repeat: no-repeat;
background-position:right;
}
.click {
height: 36px;
width: 100px;
background-color: #3388FF;
border-width: 0px;
font-size: 15px;
color: white;
}
成品: