In general, the file organization of the "standard webpage" is XHTML + CSS. XHTML is mainly used to represent the webpage structure and display content, while CSS is used to define the structure layout and modify the content style.
XHTML commonly used for layout generally includes:
DIV: it is mainly used for logical parts of page content. For example, a webpage generally contains responsibility partitions such as the header, navigation, sidebar, content, and copyright. In this case, you can use the DIV label to split.
We recommend that you name each block as follows:
Header: <div id = "masthead"> </div>
Navigate to <div id = "globalnav"> </div>
Sidebar: <div id = "navbar"> </div>
Content: <div id = "content"> </div>
Copyright: <div id = "copyright"> </div>
Note: the id is unique, that is, the ID must not appear more than twice on the same page. Otherwise, use class.
Ul: it is originally an unordered list. It is often used to represent equivalent elements of non-structural classes in XHTML + CSS applications. It must be used with the child element LI of UL.
<Div>
<Ul>
<Li> <a href = "#"> Link1 </a> </li>
<Li> <a href = "#"> Link2 </a> </li>
<Li> <a href = "#"> Link3 </a> </li>
</Ul>
</Div>
Note: Similar to ul, there are ol and ul, which are rarely used,
Span: If we compare this element with DIV, span is a bag and div is a box (meaning Xiaoyi: basic application of XHTML code ). In fact, div is a block-level element, while span is a row-level element (see inline (intra-row) elements and block-level elements ), you can use span to separately define a fragment element in one or more element sets.
For example:
<Ul>
<Li> <span> (2006-11-13) </span> XHML + CSS Layout: XHTML Application Summary </li>
</Ul>
When span is defined as left/right float in css, the date and title are displayed on both sides. Relative use
<Ul>
<Li> 2006-11-13 </li>
<Li> XHML + CSS layout summary </li>
</Ul>
It is much simpler.
========================================================
After the common XHTML labels for layout are completed, other XHTML labels are used to display webpage content. For example:
indicates the image
<A href = "" title = ""> </a> indicates a hyperlink.
<Hn> It is recommended that the h1-h6 decrease in order of importance, h1 is the most important title (see greengnn: div + css naming reference)
Originally, <B> </B> and <I> </I> are used to indicate labels in bold and italic, select <strong> </strong> and <em> </em>.