Home > Web Front-end > HTML Tutorial > Implementation summary of a website's static homepage_html/css_WEB-ITnose

Implementation summary of a website's static homepage_html/css_WEB-ITnose

WBOY
Release: 2016-06-24 11:56:55
Original
1079 people have browsed it

Source: http://www.ido321.com/842.html

Implementation of header part

   1: <div class="top">
Copy after login
   2:      <ul class="topul">
Copy after login
   3:          <li id="time"><a href="#">9月25日 周四</a></li>
Copy after login
   4:          <li><a href="#">联系我们</a></li>
Copy after login
   5:          <li><a href="#">收藏本站</a></li>
Copy after login
   6:      </ul>
Copy after login
   7:  </div>
Copy after login
   8:  <div class="header">
Copy after login
   9:      <div class="logo">
Copy after login
  10:          <a href="#"><img src="./img/logo.png" alt="xxxxx"></a>
Copy after login
  11:      </div>
Copy after login
  12:      <div class="nav">
Copy after login
  13:          <ul class="navul">
Copy after login
  14:              <li><a href="#">首页</a></li>
Copy after login
  15:              <li><a href="#">校园动态</a></li>
Copy after login
  16:              <li><a href="#">失物招领</a></li>
Copy after login
  17:              <li><a href="#">二手市场</a></li>
Copy after login
  18:              <li><a href="#">论坛专区</a></li>
Copy after login
  19:              <li><a href="#">个人中心</a></li>
Copy after login
  20:          </ul>
Copy after login
  21:      </div>
Copy after login
  22:  </div>
Copy after login
  23: </div>
Copy after login

CSS of header part

   1: .top
Copy after login
   2: {
Copy after login
Copy after login
   3:     margin-top: 1em;
Copy after login
   4: }
Copy after login
   5: .topul
Copy after login
   6: {
Copy after login
   7:     list-style: none;
Copy after login
   8:     margin-right: 3%;
Copy after login
   9:     color: #8B8989;
Copy after login
  10: }
Copy after login
  11: .topul li
Copy after login
  12: {
Copy after login
  13:     float: right;
Copy after login
  14:     margin-left: 25px;
Copy after login
  15: }
Copy after login
  16: .topul li a
Copy after login
  17: {
Copy after login
  18:     color: #8B8989;
Copy after login
  19:     text-decoration: none;
Copy after login
  20: }
Copy after login
  21: .topul li a:hover
Copy after login
  22: {
Copy after login
  23:     color: #8B8989;
Copy after login
  24:     text-decoration: none;
Copy after login
  25: }
Copy after login
  26: .header
Copy after login
  27: {
Copy after login
  28:     margin-top: 1em;
Copy after login
  29:     height:100px;
Copy after login
  30:     position: relative;
Copy after login
  31:     top: 0;
Copy after login
  32:     left: 0;
Copy after login
  33: }
Copy after login
  34: .logo
Copy after login
  35: {
Copy after login
  36:     float: left;
Copy after login
  37: }
Copy after login
  38: .nav
Copy after login
  39: {
Copy after login
  40:     float: left;
Copy after login
  41:     width: 80%;
Copy after login
  42:     position: absolute;
Copy after login
  43:     top:55%;
Copy after login
  44:     left: 20%;
Copy after login
  45: }
Copy after login
  46: .navul
Copy after login
  47: {
Copy after login
  48:     list-style: none;
Copy after login
  49:     text-align: center;
Copy after login
  50: }
Copy after login
  51: .navul li
Copy after login
  52: {
Copy after login
  53:     float: left;
Copy after login
  54:     width: 12.5%;
Copy after login
  55:     line-height: 200%;
Copy after login
  56:     margin-left: 3.5%;
Copy after login
  57:     letter-spacing: 2px;
Copy after login
  58: }
Copy after login
  59: .navul li a
Copy after login
  60: {
Copy after login
  61:     color: #000000;
Copy after login
  62:     text-decoration: none;
Copy after login
  63: }
Copy after login
  64: .navul li a:hover
Copy after login
  65: {
Copy after login
  66:     color: #000000;
Copy after login
  67:     text-decoration: none;
Copy after login
  68: }
Copy after login

For the body part, there are compatibility issues when drawing circles with css

   1: <div class="shaft">
Copy after login
   2:     <div class="past">
Copy after login
   3:         <div class="circle">
Copy after login
   4:             <a href="#"><span>1</span></a>
Copy after login
   5:         </div>
Copy after login
   6:     </div>
Copy after login
   7:     <div class="lianjie"></div>
Copy after login
   8:     <div class="now">
Copy after login
   9:         <div class="circle">
Copy after login
  10:             <a href="#"><span>2</span></a>
Copy after login
  11:         </div>
Copy after login
  12:     </div>
Copy after login
  13:     <div class="lianjie"></div>
Copy after login
  14:     <div class="future">
Copy after login
  15:         <div class="circle">
Copy after login
  16:             <a href="#"><span>3</span></a>
Copy after login
  17:         </div>
Copy after login
  18:     </div>
Copy after login
  19: </div>
Copy after login
  20: <br/><br/><br/>
Copy after login
  21: <div class="maioshu">
Copy after login
  22:     <div class="desc descpast">
Copy after login
  23:         <img src="./img/past.png" alt="past">
Copy after login
  24:         <h3>最初的梦想</h3>
Copy after login
  25:         <p>2008年医工伍学秦创立</p>
Copy after login
  26:     </div>
Copy after login
  27:     <div class="desc descnow">
Copy after login
  28:         <img src="./img/now.png" alt="now">
Copy after login
  29:         <h3>活在当下</h3>
Copy after login
  30:         <p>用爱把协会做好</p>
Copy after login
  31:     </div>
Copy after login
  32:     <div class="desc descfuture">
Copy after login
  33:         <img src="./img/future.png" alt="future">
Copy after login
  34:         <h3>展望未来</h3>
Copy after login
  35:         <p>会有个怎么样的你</p>
Copy after login
  36:     </div>
Copy after login
  37: </div>
Copy after login

Main css

   1: .circle
Copy after login
   2: {
Copy after login
Copy after login
   3:      background-color:#F8F6F5;
Copy after login
   4:      width: 50px;   /* div的宽和高为600px即正方形的边长为600px */
Copy after login
   5:      height: 50px;
Copy after login
   6:      text-align: center;
Copy after login
   7:
Copy after login
   8:      -moz-border-radius: 25px;   /* 圆的半径为边长的一半,即300px */
Copy after login
   9:      -webkit-border-radius: 25px;
Copy after login
  10:      border-radius: 25px;
Copy after login
  11:
Copy after login
  12:      display: -moz-box;
Copy after login
  13:      display: -webkit-box;
Copy after login
  14:      display: box;
Copy after login
  15:
Copy after login
  16:      -moz-box-orient: horizontal;
Copy after login
  17:      -webkit-box-orient: horizontal;
Copy after login
  18:      box-orient: horizontal;
Copy after login
  19:
Copy after login
  20:      -moz-box-pack: center;
Copy after login
  21:      -moz-box-align: center;
Copy after login
  22:
Copy after login
  23:      -webkit-box-pack: center;
Copy after login
  24:      -webkit-box-align: center;
Copy after login
  25:      box-pack: center;
Copy after login
  26:      box-align: center;
Copy after login
  27:      font:normal 25px/100%;
Copy after login
  28:      text-shadow:1px 1px 1px #000;
Copy after login
  29:      color:#000000;
Copy after login
  30: }
Copy after login

Effect

In IE, the numbers 1, 2, and 3 cannot be centered, so I added a span later (there was none before) and used IE Hacks solve

   1: <!--[if IE]>
Copy after login
   2:   <style type="text/css">
Copy after login
   3:     .circle span
Copy after login
   4:     {
Copy after login
   5:         display:block;
Copy after login
   6:         padding-top:12px;
Copy after login
   7:         font-weight:bold;
Copy after login
   8:     }
Copy after login
   9:   </style>
Copy after login
  10: <![endif]-->
Copy after login

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template