Web standards are more and more prominent, and now build stations are focused on a standard, through the website of XHTML and CSS validation, then how to make a standards-compliant site, the following is my blog reconstruction and production Osdev resource The process of some experience ^_^.
Go to the Web designer to read some articles about web standards
Although w3.org more authoritative, but for our mother tongue is Chinese, this is easier to read:) Personally feel more than go to w3.org look at those full screen e text comfortable. Here you can find a lot of articles about xthml,div+css layouts, CSS tips and more. Also has stationmaster Ateptsevo writes "The Gradual progress" the tutorial, introduced how step by step to make a conforms to the standard website.
drop table, use DIV+CSS layout
This seems to be the first thing you should do to design a standard-compliant web page: The Div+css layout is also a trend. With Div+css layout can refer to w3cn.org article: CSS Basic layout 16 cases, typical three rows two columns center height adaptive layout.
Close Label
In the past, we may not be aware of the problem of closing the label, such as Img,p, and so on, when using these tags is often used only the beginning, and did not properly close it. Typically, we do this with IMG:
But in XHTML, such a situation is not allowed, but it should be closed:
In addition, such as paragraph marks
, which used to be directly a
, without thinking of adding at the end of the paragraph
, which is not allowed in XHTML.
Nesting labels correctly
The fault tolerance of the browser allows us to write a Web page that does not conform to the rules to get the correct display effect, such as
Sample
There is no problem, and again, this is not allowed in XHTML. XHTML comes from XML, and XML must be structured, so nested tags must be nested one layer at a time, not interleaved.
Set character sets correctly
There doesn't seem to be much of a relationship, but setting a good character set is more conducive to browser parsing of documents.
Alignment of the picture
In XHTML, the Align property can only be one of the three values of left, middle, right, or top, middle, bottom, and many times we need the image to be absolutely aligned with the text, that is, absmiddle. After using XHTML, you will lose this attribute, the workaround? I do not know, but the web designer in the article has mentioned this problem, I in the blog reconstruction, the picture alignment is set to top, the display effect is also passable.
Handling & in Links
Dynamic Web site When you use the Get method to pass parameters, if there are more than one parameter, you will use & to connect the parameters, but in XHTML if there is a & in order to be an entity, but no one should take the name of the parameter nbsp, lt, gt such bar. It is stipulated in XHTML that all & that are not entities must be converted to &, and if not converted, an error will be found in the calibration.
In fact, personal feeling in accordance with the standard to make a site more easily than the traditional way to make a site, because the structure and content separation, in changing the display effect does not need the entire page to re-do, just need to rewrite the style in the CSS line. and convenient after the revision of what, and again, such as Fdream FBS, no refreshing skin, good stuff ~ ~