<!DOCTYPE html> <html> <head> <meta charset="utf-8"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>无标题文档</title> <link rel="stylesheet" href="css/main.css"> <script src="js/setHomeSetFav.js" type="text/javascript" charset="gb2312"></script> </head> <body> <div class="top"> <div class="top_content"> <ul> <li><a href="#">联系我们</a></li> <li><a href="#" onclick="AddFavorite(window.location, document.title)">加入收藏</a></li> <li><a href="#" onclick="SetHome(window.location)">设为首页</a></li> </ul> </div> </div><!-- top结束 --> <div class="wrap"> <div class="logo"> <div class="logo_left"> <img src="images/logo.jpg" alt="慕课网"> </div> <div class="logo_right"> <img src="images/tel.jpg" alt="服务热线">24小时服务热线:<span class="tel">123-456-7890</span> </div> </div><!-- logo结束 --> </div><!-- wrap结束 --> </body> </html>
@charset "utf-8" /*CSS Document*/ *{ margin: 0; padding: 0; } body{ font-size: 12px; background-color: #f5f5f5; } /*top区域样式*/ .top{ width: 100%; height: 27px; background: url(../images/top_bg.jpg) repeat-x; } .top_content{ width: 1000px; margin: 0 auto; } .top_content li{ list-style-image: url(../images/li_bg.gif); float:right; width:70px; line-height: 27px; } .top_content a:link, .top_content a:visited{ color: #8e8e8e; text-decoration: none; } .top_content a:hover, .top_content a:active{ color: #900; text-decoration: none; } /*logo区域样式*/ .wrap{ width: 1000px; margin: 0 auto; } .logo{ height: 80px; background: #fff; } .logo_left{ width: 200px; float: left; } .logo_right{ width: 300px; float: right; height: 28px; margin-top: 30px; color: #8e8e8e; font-size: 14px; } .logo_right img{ vertical-align: middle; margin-right: 10px; } .tel{ font-family: "微软雅黑"; font-size: 16px; color: #c00; }
* { margin:0; padding:0; font-size:12px; } body { background-color:#F5F5F5; }
按教程是这样的