效果图
html代码
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
<link rel="stylesheet" href="./css/baidu.css">
</head>
<body>
<div class="nav">
<a href="http://news.baidu.com/">新闻</a>
<a href="https://www.hao123.com/?src=from_pc_logon/">hao123</a>
<a href="http://map.baidu.com/">地图</a>
<a href="http://tieba.baidu.com/">贴纸</a>
<a href="https://haokan.baidu.com/?sfrom=baidu-top">视频</a>
<a href="http://image.baidu.com/">图片</a>
<a href="https://pan.baidu.com/?from=1026962h/">网盘</a>
<a href="http://www.baidu.com/more/">更多</a>
<button>登录</button>
<span>设置</span>
</div>
<div class="header">
<div class="logos">
<img class="logo" src="https://www.baidu.com/img/PCtm_d9c8750bed0b3c7d089fa7d55720d6cf.png" alt="">
</div>
<div class="search">
<input type="text" class="text">
<input type="button" value="百度一下" class="button">
</div>
</div>
<div class="content">
<div class="one"><strong> 百度热搜</strong>></div>
<div class="two" style="text-align: right;"><span>换一换</span></div>
<div style="display: flex;">
<img src="./img/top.png" alt="">
<a href="#">置顶热搜置顶热搜</a>
</div>
<div>
<span style="color: #faa90e;">3</span>
<a href="#">第三个热搜第三个热搜</a>
<span class="top">热</span>
</div>
<div>
<span class="one" style="color: #fe2d46;">1</span>
<a href="#">第一个热搜第一个热搜</a>
<span class="top">热</span>
</div>
<div>
<span style="color: #9195a3;">4</span>
<a href="#">第四个热搜第四个热搜</a>
</div>
<div>
<span style="color: #f60;">2</span>
<a href="#">第二个热搜第二个热搜</a>
<span class="top">热</span>
</div>
<div>
<span style="color: #9195a3;">5</span>
<a href="#">第五个热搜第五个热搜</a>
</div>
</div>
<div class="footer">
<a>关于百度</a>
<a>About Baidu</a>
<a>使用百度前必读</a>
<a>帮助中心</a>
<a>企业推广</a>
<a>京公网安备11000002000001号</a>
<a>京ICP证030173号</a>
<a>信息网络传播视听节目许可证0110516</a>
<span class="unique">互联网宗教信息服务许可证编号:京(2022)0000043</span>
</div>
</body>
</html>
css样式
body {
margin: 0;
padding: 0;
min-width: 1500px;
}
.nav {
margin-top: 20px;
width: 100%;
font-size: 13px;
height: 40px;
}
.nav a {
margin-left: 20px;
text-decoration: none;
color: black;
}
.nav a:hover {
color: #4c6fef;
}
.nav span, button {
float: right;
margin-right: 20px;
cursor: pointer;
}
.nav span:hover {
color: #4c6fef;
}
.nav button {
background-color: #4c6fef;
color: white;
border-radius: 19%;
margin-top: -3px;
border: none;
line-height: 23px;
}
.logos {
text-align: center;
}
.logo {
width: 263px;
}
.search {
margin-top: 2%;
position: relative;
display: flex;
justify-content: center;
}
.text {
background: url(../img/search.png) right center no-repeat;
}
.search .text {
width: 516px;
height: 36px;
border: 1px solid #a7aab4;
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
outline: 1px solid #a7aab4;
}
.text:focus {
outline: 1px solid #4c6fef;
}
.search .button {
width: 105px;
border: none;
font-size: 16px;
height: 42px;
margin-top: -1px;
color: white;
background-color: #4d6ef1;
border-bottom-right-radius: 10px;
border-top-right-radius: 10px;
}
.content {
display: flex;
flex-wrap: wrap;
width: 45%;
margin-left: 29%;
margin-top: 4%;
height: 13%;
justify-content: space-evenly;
}
.one {
width: 50%;
}
strong:hover {
color: #4c6fef;
cursor: pointer;
}
.two {
color: #9195a3;
width: 50%;
}
.two span {
text-align: right;
cursor: pointer;
}
.two span:hover {
color: #4c6fef;
cursor: pointer;
}
.content div {
width: 50%;
text-align: left;
padding-top: 7px;
}
.content div a {
text-decoration: none;
color: black;
}
.content div a:hover {
text-decoration: underline;
color: #4c6fef;
}
.top {
background-color: #f60;
color: #fff;
line-height: 26px;
font-size: 13px;
border-radius: 3px;
padding: 1px 2px;
}
.footer {
font-size: 6%;
color: #a7aab4;
text-align: center;
position: absolute;
bottom: 3%;
width: 1500px;
}
.footer span, a {
text-decoration: none;
bottom: 3%;
margin-left: 1%;
}
.unique:hover {
cursor: default;
}
.footer a:hover {
cursor: pointer;
color: black;
}