CSS仿站——南讯1--头部区域制作
CSS仿站——南讯1--头部区域制作
html:
<div class="top"> <div class="m2"> <div class="left"> <h1><a href="" title='专业的全网营销和网站运营机构'>专业的全网营销和网站运营机构</a></h1> </div> <div class="right"> <div class="rito"> <a href=""><i></i>技术研究院</a> <a href=""><i></i>联系我们</a> </div> </div> <div class="clear"></div> </div> </div>
css:
body{ margin:0; background-color: #F0EAE6; } body,td,th{ color: #333; font-size: 12px; font-family: "Microsoft YaHei", "Lato", "Helvetica Neue", Helvetica, Arial, sans-serif; } .top{ width: 100%; height: 120px; background-color: #F0EAE6; } .m2{ width: 1130px; margin:0 auto; } .left{ float: left; } .right{ float: right; } .clear{ float: none; clear: both; } .top .m2 .left h1{ margin: 0; padding: 0; } .top .m2 .left h1 a{ /*将 行元素 转成 块元素*/ display: block; width: 500px; height: 120px; line-height: 1200px; /*溢出隐藏*/ overflow: hidden; background-image: url(../img/logo.png); background-repeat: no-repeat; background-position: left center; } .top .m2 .right .rito{ padding-top: 18px; } .top .m2 .right .rito a{ display: block; width: 93px; float: left; color: #fff; background-color: #336699; text-align: center; border-radius: 4px; text-decoration: none; margin-right: 20px; padding-top: 5px; padding-bottom: 5px; }
还没有留言,还不快点抢沙发?