码迷,mamicode.com
首页 > Web开发 > 详细

2019.12.5-网站首页代码(浮动)

时间:2019-12-06 00:03:32      阅读:108      评论:0      收藏:0      [点我收藏+]

标签:bsp   absolute   doctype   定位   ali   首页   image   relative   sof   

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>布局实例</title>
</head>
<style type="text/css">
.menu{
list-style: none;
background-color: #55a8ea;
padding: 0;
width: 960px;
height:40px;
margin: 50px auto 0;
position: relative; /* 相对定位 */
}

.menu li{
float: left;
width: 100px;
height: 40px;
text-align: center;
line-height: 40px;
}

.menu li a{
/* font-size: 14px;
font-family: ‘Microsoft Yahei‘;
color: #fff; */
font:14px/40px ‘Microsoft Yahei‘;
color: #fff;
text-decoration: none;
}

.menu li:hover{
background-color: #00619f;
}

.menu .active{
background-color: #00619f;
}

.menu .new{
width: 58px;
height: 35px;
background: url(images/new.png) no-repeat;
position: absolute;
left: 422px;
top: -18px;
}

.menu .new:hover{
background: url(images/new.png) no-repeat;
}

</style>
<body>

<ul class="menu">
<li class="active"><a href="">首 页</a></li>
<li><a href="">网站建设</a></li>
<li><a href="">网站建设</a></li>
<li><a href="">网站建设</a></li>
<li><a href="">网站建设</a></li>
<li><a href="">网站建设</a></li>
<li><a href="">网站建设</a></li>
<li class="new"></li>
</ul>

</body>
</html>

 

技术图片

 

 

2019.12.5-网站首页代码(浮动)

标签:bsp   absolute   doctype   定位   ali   首页   image   relative   sof   

原文地址:https://www.cnblogs.com/lishuide/p/11992854.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!