On the Concept of Div + CSS another blog has been written a lot: http://blog.csdn.net/cjl5678/article/details/7606229
Next, I knocked on a small demo to enhance my understanding of Div + CSS and understand the usage skills in this area. The instance is mainly used to set the banner of the website.
The code above HTML:
<Head> <meta http-equiv = "Content-Type" content = "text/html; charset = gb2312 "/> <title> Banner Design </title> <% -- add CSS reference -- %> <link href = ".. /banner/banner.css "rel =" stylesheet "type =" text/CSS "/>
CSS code:
Body {/* Background setting */background-image: url(backgroundimage.jpg);} # Banner {/* overall banner Layout */Text-align: center; position: absolute; /* set the webpage center */width: 700px; margin-left:-350px; left: 50%;} ul {list-style: none; margin-top: 2px; margin-left:-41px;} li {/* clear List format */list-style: none; margin: 1px; float: Left ;} A {/* tag button style setting * // * remove original format */Text-Decoration: none;/* set button new style */padding: 3px; Background-image: url(button.jpg); background-repeat: Repeat-X; color: # ffffff;} A: hover {/* hover the mouse event to achieve the button effect */Text-Decoration: none; background-image: none; Background-color: # 0099ff; color: #000000 ;}
:
Main tips used in the instance:
(1) Implement the button Effect
(2) Use of nested IDS