仿百度首页完整版

效果:
在这里插入图片描述
文档结构:
在这里插入图片描述
从网页上摘下来的图片(省的自己去弄雪碧图)
在这里插入图片描述
源码:
html+js(少量,内嵌)

<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<meta name="viewport" content="width=device-width, initial-scale=1.0">
	<title>Document</title>
	<link rel="stylesheet" href="css/style.css">
</head>
<body>
	<div class="nav ">
		<div class="navleft">
			<a href="#">新闻</a>
			<a href="#">hao123</a>
			<a href="#">地图</a>
			<a href="#">直播</a>
			<a href="#">视频</a>
			<a href="#">贴吧</a>
			<a href="#">学术</a>
			<a href="#" id="more">更多</a>
			<div id="ha">
			<table>
				<tr>
					<td><div style="text-align: center;"><a href="#" class="blo"><img src="images/a1.png" alt=""></a></br><a href="#">翻译</a></div></td>
					<td><div style="text-align: center;"><a href="#" class="blo"><img src="images/a2.png" alt=""></a></br><a href="">学术</a></div></td>
					<td><div style="text-align: center;"><a href="" class="blo"><img src="images/a3.png" alt=""></a></br><a href="">文库</a></div></td>
				</tr>
				<tfoot>
					<tr><td colspan="3" style="text-align: center;"><a href="#">查看全部百度产品></a></td></tr>
				</tfoot>
			</table>
			</div>
	    </div>
	    <div class="navright">
	    	<a href="#" id="login">登录</a>
	    	<a href="#">设置</a>
	    </div>
	</div>
	<div class="main">
	    <div class="pic">
		    <a href=""><img src="images/1.png" alt=""></a>
	    </div>
	    <div class="search">
	    	<div class="holder">
		        <input type="text" id="searchcontent"/>
		        <div class="photo"></div>
		        <a href="#">百度一下</a>
		    </div>
	    </div>
	</div>
	<div class="foot">
		<div class="footout">
		<a href="#">关于百度</a>
		<a href="#">about BaiDu</a>
		<a href="#">使用百度必读</a>
		<a href="#">帮助中心</a>
		<a href="#">京备10212222200</a>
		</div>
	</div>
	<script>
		let moreBtn=document.getElementById("more");
		let haBtn=document.getElementById("ha");
		let searchBtn=document.getElementById("searchcontent");
		moreBtn.onmouseover=function(){
			haBtn.style.display="block";
		}
		moreBtn.onmouseout=function(){
			haBtn.style.display="none";
		}
		haBtn.onmouseover=function(){
			haBtn.style.display="block";
		}
		haBtn.onmouseout=function(){
			haBtn.style.display="none";
		}
	</script>
</body>
</html>

css

/*css reset*/
html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, font, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td {
margin: 0;
padding: 0;
border: 0;
outline: 0;
font-size: 100%;
vertical-align: baseline;
background: transparent;
}
body {
line-height: 1;
}
ol, ul {
list-style: none;
}
blockquote, q {
quotes: none;
}
blockquote:before, blockquote:after,
q:before, q:after {
content: ”;
content: none;
}
/* remember to define focus styles! */
:focus {
outline: 0;
}
/* remember to highlight inserts somehow! */
ins {
text-decoration: none;
}
del {
text-decoration: line-through;
}
/* tables still need ‘cellspacing=”0″‘ in the markup */
table {
border-collapse: collapse;
border-spacing: 0;
}
/*end*/
.navleft{
	float: left;
	height: 40px;
}
.navright{
	float: right;
	height: 40px;
}
.nav{
	*zoom:1;
}
#ha{
	width: 180px;
	height: 150px;
	border-radius: 10px;
	position: absolute;
	top: 40px;
	left: 340px;
	box-shadow: 5px 0 5px lightgray,
				0 -5px 5px lightgray,
				0 5px 5px lightgray,
				5px 0 5px lightgray;
	display: none;
}
.nav::after{
	clear: both;
	content: "";
	display: block;
	height: 0;
	visibility: hidden;
}
.navleft>a{
	font: 13px/23px Arial,sans-serif;
	float: left;
	text-decoration: none;
	color: black;
	margin: 10px;
	padding : 5px 10px;
}
.navright>a{
	font: 13px/23px Arial,sans-serif;
	float: right;
	text-decoration: none;
	color: black;
	margin: 20px;
	padding: 3px 10px;
}
table a{
	font: 13px/23px Arial,sans-serif;
	text-decoration: none;
	margin: 5px;
	padding: 5px;
}
table img{
	width: 42px;
    height: 42px;
    margin-top: 8px;
    margin-left: 8px;
    margin-right: 8px;
    border: 1px solid rgba(0,0,0,.03);
    border-radius: 8px;
    display: block;
}
.nav a:hover{
	color: blue;
}
table div:hover{
	color: blue;
	background-color: rgba(0,0,0,.03);
}
#login{
	background-color: #7B8EF4;
	color: white;
	border-radius: 5px;
}
#login:hover{
	background-color:#4E6EF2;
}
.main{
	text-align: center;
}
.pic{
	text-align: center;
}
.pic img{
	width: 300px;
	height: 150px;
}
.search{
	text-align: center;
	width:100% ;
	height: 30px;
}
.foot{
	position: fixed;
	bottom: 0px;
}
.footout{
	width: 100%;
	display: flex;
	justify-content: center;
	align-items: center;
}
.foot a{
	padding-left: 200px;
	text-decoration: none;
	color: black;
}
.search{
	text-align: center;
}
.holder{
	display: inline-block;
	position: relative;
}
#searchcontent{
	height: 36px;
	width: 500px;
	float: left;
	border-style: solid;
	border-radius: 10px 0 0 10px;
	border-width: 2px;
	border-color: lightslategray;
	color: black;
}
.photo{
	position: absolute;
	background: url("../images/2.png") no-repeat -0px -48px;
	left: 480px;
	top: 10px;
	width: 24px;
	height: 20px;
}
.photo:hover{
	background: url("../images/2.png") no-repeat -0px -72px;
}
#searchcontent:focus{
	border-color: blue !important;
}
#searchcontent:hover{
	border-color: black;
}
.search a{
	text-decoration: none;
	display: inline-block;
	width: 100px;
	/*这里也可以使用基线对齐,height40px*/
	height: 42px;
	line-height: 36px;
	text-align: center;
	border-radius: 0px 5px 5px 0px;
	font-family: "微软雅黑";
	cursor: pointer;
	background-color: #4E6EF2;
	color: white;
	float: left;
}
.search::after{
	clear: both;
	content: "";
	display: block;
	height: 0;
	visibility: hidden;
}
.search a:hover{
	background-color: blue;
}
#ai{
	margin: 0 auto;
	width: 50px;
	height: 50px;
	background-color: red;
}
  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 打赏
    打赏
  • 0
    评论
用户名,Email地址,昵称 ajax无刷新验证是否已注册 非空验证 用户名验证:由英文字母和数字组成的4-16位字符,以字母开头! 邮箱验证:Email格式不正确,例如web@sohu.com 昵称验证:由汉字组成的2-8位字符! 密码验证:密码不能含有非法字符,长度在4-10之间 再次输入密码验证:两次输入密码不一致! 注册成功后用户直接保存在session里进入登录页面 搜索框实现智能联想(根据关键字联想贴吧名搜索) 登录成功用户保存在session中显示用户昵称 登录失败显示(登录失败!请重新) 注销可以销毁session中的用户对象 横条广告用flash制作替换效果 个人中心显示用户头像及昵称 奇吧朵朵展示留个贴吧信息(滚动文字) 最新话题展示最新发帖标题并可点击进入 常逛贴吧由用户登录后显示 贴吧分类显示不同类型贴吧鼠标移动上去展示贴吧名 热帖分类展示四个贴吧四条回复 热帖排行榜显示回复最多三个帖子 顶部展示贴吧名称,会员数,帖子数,以及帖吧简介 帖子显示回复次数,标题,内容25字符发帖昵称以及发帖时间 签到按钮可以判断是否登录,签到成功次数加一,提示以签到 显示用户头像和昵称 恢复按钮AJAX判断是否登录,登录后方可发帖 右侧游戏动态加载 翻页可实现看第一页,向前和向后翻页 顶部显示广告,帖子标题 只看楼主可实现只看楼主发表内容,取消只看楼主查看全部回复 显示回复用户头像和昵称,回复内容签名档,楼层,发表时间 关注AJAX判断用户是否已登录,关注成功次数加一,已关注提示 鼠标移动到用户头像可查看用户信息 实现翻页功能 回复条数,返回当前贴吧 回复按钮AJAX判断是否已登录,登陆后方可发帖 我的帖子显示吧名,标题,回复次数,发帖时间,删除提示,删除失败提示 我关注的帖吧显示把名,标题,回复次数,发帖时间,删除提示,删除失败提示

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

returnadsss

你的鼓励将是我创作的最大动力

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值