XHTML + CSS Layout: XHTML Application Summary

Source: Internet
Author: User

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>.

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.