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>百度一下,你就知道</title>
<link rel="stylesheet" href="./baidu.css">
</head>
<body>
<header class="top">
<!-- 导航栏开始 -->
<nav>
<a href="http://news.baidu.com/">新闻</a>
<a href="https://www.hao123.com/">hao123</a>
<a href="https://map.baidu.com/">地图</a>
<a href="https://live.baidu.com/">直播</a>
<a href="https://haokan.baidu.com/?sfrom=baidu-top">视频</a>
<a href="https://tieba.baidu.com/index.html">贴吧</a>
<a href="https://xueshu.baidu.com/">学术</a>
<a href="https://www.baidu.com/more/">更多</a>
</nav>
<!-- 导航栏结束 -->
</header>
<!-- 搜索框上的图片 图片路径可更改 -->
<div class="picture">
<a target="blank" href="file:///C:/Users/huawei/OneDrive/%E5%9B%BE%E7%89%87/%E5%B1%8F%E5%B9%95%E5%BF%AB%E7%85%A7/360%E6%88%AA%E5%9B%BE20220522084548676.jpg"><img src="../image/100.png" width=270px target="blank" /></a>
</div>
<!-- 搜索框开始 -->
<div class="search">
<div class="div1">
<input type="text" width=546px height=45px />
</div>
<!-- 百度一下按钮 -->
<div class="div2">
<input type="button" width=110px height=45px value="百度一下"/>
</div>
</div>
<!-- 搜索框结束 -->
<!-- 百度热搜开始 -->
<div class="hot_search">
<div>
<a href="https://top.baidu.com/board?platform=pc&sa=pcindex_entry">百度热搜</a>
</div>
<!-- 热搜词条 -->
<div>
<div class="hot_search_list1">
<ul>
<li><a href="https://mbd.baidu.com/newspage/data/videolanding?nid=sv_7573517534280825817&sourceFrom=pc_feedlist" target="blank"><font color="red"> 1 </font> 袁隆平院士逝世一周年 120秒缅怀斯人 <span> 热 </span></a></li>
<li><a href="https://baijiahao.baidu.com/s?id=1733292689909006423" target="blank"><font color=#FF8C00> 2 </font> 产业升级态势没有改变 </a></li>
<li><a href="https://baijiahao.baidu.com/s?id=1733481772022730560&wfr=spider&for=pc" target="blank"><font color=#FFA500> 3 </font> 上海昨日新增本土52+570新增本土死亡3例 </a></li>
</ul>
</div>
<div class="hot_search_list2">
<ul>
<li><a href="https://m.gmw.cn/2022-05/22/content_1302958209.htm" target="blank"><font color="gray"> 4 </font> 风吹过稻田我又想您了 </a></li>
<li><a href="https://baijiahao.baidu.com/s?id=1733481882132224570&wfr=spider&for=pc" target="blank"><font color="gray"> 5 </font> 金鹰奖取消观众喜爱的男女演员奖 </a></li>
<li><a href="https://baijiahao.baidu.com/s?id=1733450962630802309" target="blank"><font color="gray"> 6 </font> 两个中立国不再中立 释放什么信号? </a></li>
</ul>
</div>
</div>
<!-- 百度热搜结束 -->
</div>
<!-- 尾部开始 -->
<footer class="bottom">
<div>
<a class="bottom_" target="blank" href="https://www.baidu.com/cache/setindex/index.html">设为首页</a>
<a class="bottom_" target="blank" href="https://home.baidu.com/">关于百度</a>
<a class="bottom_" target="blank" href="https://ir.baidu.com/">About baidu</a>
<a class="bottom_" target="blank" href="https://www.baidu.com/duty/">使用百度前必读</a>
<a class="bottom_" target="blank" href="http://help.baidu.com/newadd?prod_id=1&category=4">意见反馈</a>
<a class="bottom_" target="blank" href="https://help.baidu.com/">帮助中心</a>
<a class="bottom_" target="blank" href="http://www.beian.gov.cn/portal/registerSystemInfo?recordcode=11000002000001">京公网安备11000002000001</a>
<a class="bottom_" target="blank" href="https://beian.miit.gov.cn/#/Integrated/index">京ICP证030173号</a>
<a href="#">2021baidu</a>
<a href="#">(京)-经营性-2017-0020</a>
<a class="bottom_" target="blank" href="https://www.baidu.com/licence/">信息网络传播视听节目许可证0110516</a>
</div>
</footer>
<!-- 尾部结束 -->
</body>
</html>
css界面
*{
margin: 0;
padding: 0;
font-size: 14px;
font-family: '微软雅黑';
box-sizing: border-box;
}
.top{
/* 定义导航栏的位置
设置外边距使其距顶部20px 距离左右侧边均为25px 距底边5px
margin:上 右 下 左 ;
margin: 上 左右 下 ;
margin: 上下 左右 ;
margin: 四周 ;
*/
margin: 20px 25px 5px ;
}
/* 删掉超链接自带的下划线 */
a{
text-decoration: none;
}
nav a{
/* 设置内边距 */
padding-right: 23px;
/* 定义字体颜色 */
color: dimgray;
}
/* 当鼠标悬停在此处时的状态 */
nav a:hover{
padding-right: 23px;
text-decoration: none;
color:blue;
}
.picture{
/* 居中 */
text-align: center;
}
.search{
padding-top: 20px;
/* 定义两个容器的排列方式 flex默认为水平布局 */
display: flex;
/* 居中 */
justify-content: center;
margin-top: -10px;
margin-bottom: 30px;
}
.div1 input{
/* 设置文本输入框的大小 */
height: 44px;
width: 538px;
padding: 0 15px;
/* 并排放置两个带边框的框*/
box-sizing: border-box;
/* 设置边框宽度 */
border-bottom: 2px solid #acb1c0;
border-left: 2px solid #acb1c0;
border-top: 2px solid #acb1c0;
border-right: 0px solid #acb1c0;
/* 设置边框的拐角弧度 */
border-top-left-radius: 10px;
border-bottom-left-radius: 10px;
}
.div2 input{
/* 设置按钮的大小 */
width: 110px;
height: 44px;
/* 设置框内字体颜色及大小 */
color: #fff;
font-size: 17px;
/* 框的填充颜色 */
background-color: #4E6EF2;
/* 定义两个容器的排列方式 flex默认为水平布局 */
display: flex;
justify-content: center;
/* 按钮内的字居中 */
align-items: center;
/* 设置边框宽度 */
border: 0;
/* 设置边框的拐角弧度 */
border-top-right-radius: 10px;
border-bottom-right-radius: 10px;
}
.hot_search{
width: 638px;
margin: auto;
/* 设置行间距 */
line-height: 30px;
}
.hot_search div a{
text-decoration: none;
color: dimgray;
}
.hot_search_list1{
width:50%;
/* 设置该盒子处于左侧 */
float: left;
/* 设置行间距 */
line-height: 30px;
color: dimgray;
}
.hot_search_list2{
width:50%;
/* 设置该盒子处于右侧 */
float: right;
/* 设置行间距 */
line-height: 30px;
color: dimgray;
}
ul li a:hover{
color: blue;
}
/* 热搜词条后边的小标志 */
li a span{
color: white;
background-color: orange;
border-radius: 5px;
}
/* 删掉无序列表自带的小黑点 */
ul li{
list-style-type: none;
}
.bottom div{
margin: auto;
text-decoration: none;
}
/* 鼠标悬停时的状态 */
.bottom_:hover{
font-size: small;
text-decoration: none;
color:black;
padding-right: 15px;
}
.bottom div a{
font-size: small;
color: rgb(168, 166, 166);
padding-right: 15px;
}
.bottom{
text-align: center;
/* 将尾部置于页面底部 */
position: fixed;
left: 0;
bottom: 0;
width: 100%;
height: 30px;
}