用html和css写一个仿百度首页
程序员文章站
2022-04-24 12:38:54
...
- 效果图如图:
- baidu.html
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>百度一下,你就知道</title>
<link rel="shortcut icon" type="image/x-icon" href="./images/1.ico" />
<link rel="stylesheet" href="css/css1.css" />
</head>
<style>
*{
margin: 0;
padding: 0;
}
body{
width: 100%;
}
.outer .first a{
font-family: "微软雅黑";
font-size: small ;
color: #777;
font-weight:bold ;
}
.outer .first a:hover{
color: blue;
}
.outer{
width: 1600px;
}
.first{
position: absolute;
top: 10px;
right: 0px;
}
.second{
height:400px;
padding-left: 480px;
padding-top: 100px;
}
.thrid{
width:1595px;
height:280px;
position: relative;
}
.first .product{
background:cornflowerblue;
display: inline-block;
top: 0;
height: 30px;
width: 62px;
text-align: center;
}
.first .more{
width: 60px;
height: 25px;
color: #fff;
background: #38f;
line-height: 22px;
font-size: 13px;
text-align: center;
border-bottom: 1px solid #38f;
margin-left: 5px;
margin-top: 0px;
}
.first .product a{
color: white;
text-decoration: none;
}
.second_input{
width: 600px;
height: 40px;
border: 1px solid dodgerblue;
position: absolute;
left: 320px;
top: 240px;
}
.second_button{
width: 100px;
height: 41px;
color: white;
background: #317ef3;
border: 0;
font-size:medium;
position: absolute;
top:240px;
left: 850px;
}
.thrid .h{
position: absolute;
top:38px;
left:450px;
width: 550px;
height: 20px;
font-size: smaller;
}
.thrid .r{
position: absolute;
top:56px;
left:530px;
width: 580px;
height: 20px;
font-size: smaller;
}
.thrid .r img{
width: 16px;
height: 16px;
float: left;
}
.thrid a{
font-family: "微软雅黑";
font-size: smaller;
color: gray;
}
</style>
<body>
<div class="outer">
<div class="first">
<a href="http://news.baidu.com/" target="_blank">新闻</a>
<a href="https://www.hao123.com/" target="_blank">hao123</a>
<a href="https://map.baidu.com/" target="_blank">地图</a>
<a href="http://v.baidu.com/" target="_blank">视频</a>
<a href="https://tieba.baidu.com/index.html" target="_blank">贴吧</a>
<a href="http://xueshu.baidu.com/" target="_blank">学术</a>
<a href="">用户名</a>
<a href="">设置</a>
<span class="product more">
<a href="https://www.baidu.com/more/" target="_blank">更多产品</a>
</span>
</div>
<div class="second">
<img src="./images/3.png" width="320px" height="139px" />
<input type="text" class="second_input"/>
<input type="button" class="second_button" value="百度一下"/>
</div>
<div class="thrid">
<!-- <img src="./imges/2.jpg" height="60" width="60" class="er"/><br/> -->
<div class="h">
<a href="">设为首页</a>
<a>©2019 Baidu</a>
<a href="">使用百度前必读</a>
<a href="">意见反馈</a>
<a>京ICP证030173号</a> <br>
</div>
<div class="r">
<img src="./images/2.jpg">
<a> 京公网安备11000002000001号</a>
</div>
</div>
</body>
</html>
1.title前加百度图标的方法:在title下面加上下面代码,href中放图片.ico的位置
<link rel="shortcut icon" type="image/x-icon" href="./images/1.ico" />
推荐阅读
-
html写css样式(用html和css做网页完整代码)
-
仿百度图片首页--HTML+CSS练手项目1【Table】
-
用Html+Css+JavaScript中的事件和正则表达式做一个“个人信息登记表“
-
前端学习笔记(五)HTML+CSS静态页面实战案例:幸福西饼首页和百度首页
-
用Html写一个简单的登陆界面_html/css_WEB-ITnose
-
用C3中的animation和transform写的一个模仿加载的时动画效果_html/css_WEB-ITnose
-
咨询一个问题:用ul li 写的导航栏,下拉菜单怎么不显示? 谢谢各位_html/css_WEB-ITnose
-
用css和html实现的一个forest logo
-
用php 和 html写的程序 每次重新打开都乱码。必须每次打开调整浏览器的view_html/css_WEB-ITnose
-
咨询一个问题:用ul li 写的导航栏,下拉菜单怎么不显示? 谢谢各位_html/css_WEB-ITnose