myth one. Multiple div syndrome
<div class= "NAV" > <ul> <li><a href= "/home/" >Home</a></li> <li ><a href= "/about/" >About</a></li> <li><a href= "/concact/" >Concact</a> </li> </ul></div>
Simplified into the following
<ul class= "NAV" > <li><a href= "/home/" >Home</a></li> <li><a href= "/ about/">About</a></li> <li><a href="/concact/">Concact</a></li> </ Ul>
Myth Ii. Multi-class class Syndrome note class can be applied to any number of elements of a page, and is ideal for identifying content types or other similar entries
A piece of news (news headlines, news details) class News-head and News-text multi-class manifestations, do not require so many classes to differentiate element styles
<H1 class= "News-head" >elastic Layout example-view Source for the HTML and css
It is best to use Div (division) to represent part rather than without semantics (most people misunderstand div without semantics!!!) ), You can divide the document into several meaningful areas, the class name news, to identify the entire news item.
You can then use the cascading (Cascade) style to identify news headlines, text
<div class= "News" >
span groups or identifies inline elements
myth three. ID usage myths Identify specific elements on a page (such as site navigation, headers, footers) and must be unique, and can be used to identify persistent structural elements such as main navigation, content area
/* Large number of Use IDs, difficult to find unique name confusion */#andy, #rich, #jeremy, #james-box, #sophie {font-size:1em;font-weight:bold;border:1px solid # CCC;} /* Simply replace it with a common class */.staff {font-size:1em;font-weight:bold;border:1px solid #ccc;}
Used to identify specific elements on a page (such as site navigation, headers, footers) and must be unique; can also be used to identify persistent structural elements (such as main navigation, content area)
Common CSS and HTML usage errors