Summary of things to pay attention to in XHTML CSS design under Web2.0_Experience exchange

WBOY
Release: 2016-05-16 12:06:46
Original
1442 people have browsed it

Notes:
1. Statements other than selecting DOCTYPE must be written in lowercase English letters. These include mouse actions generated by Macromedia Dreamweaver, such as OnMouseOver, which must also be modified to onmouseover.

2. XHTML syntax requires that all tags must have a beginning and an end. For example,

and ,

and

, etc. For unpaired tags, it is required to add a space at the end of the tag, followed by a "/". For example,
is written as
and Summary of things to pay attention to in XHTML CSS design under Web2.0_Experience exchange is written as Summary of things to pay attention to in XHTML CSS design under Web2.0_Experience exchange. The reason for adding spaces is to prevent the browser from not recognizing the codes when they are connected together.

3. All XML tags must be nested reasonably. For example:

must be changed to:

, that is to say, the nesting layer by layer must be strictly symmetrical.

4. All attributes must be enclosed in quotation marks "". For example: must be modified to: . In special cases, you need to use double quotes in the attribute value, you can use ", single quotes can use ', for example: .

5. Put all ), which is not part of the label, must be encoded as & g t ; , any ampersand (&) that is not part of the entity must be encoded as & amp ; . (There are no spaces between the above code letters)

6. Assign a value to all attributes. For example : must be modified to: .

7. Do not use "--" in the comment content.For example: You can replace the internal dotted lines with equal signs or spaces .

The first is the standard way of writing the file header:

CODE:
ttp://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd\" target=\"_blank\">http://www.w3.org/TR/xhtml1/DTD /xhtml1-transitional.dtd">
http ://www.w3.org/1999/xhtml" lang="utf-8">








[Copy to clipboard]



In terms of the definition of CSS, it is worth recommending a universal font setting scheme, the content is as follows:
CODE:
body { font -family : "Lucida Grande", Verdana, Lucida, Arial, Helvetica, Song Dynasty, sans-serif; }
[Copy to clipboard]


Fonts are selected in the order listed. If the user's computer contains the Lucida Grande font, the document will be designated Lucida Grande.If not, it is designated as the Verdana font, if there is no Verdana, it is designated as the Lucida font, and so on;

Lucida Grande font is suitable for Mac OS X;

Verdana font is suitable for all Windows system;

Lucida is suitable for UNIX users;

"Song Ti" is suitable for simplified Chinese users;

If none of the listed fonts are available, the default sans-serif Fonts are guaranteed to be called.


Four pseudo-classes are used in CSS to define link styles, namely: a:link, a:visited, a:hover and a:active, for example:

a :link{font-weight : bold ;text-decoration : none ;color : #c00 ;}
a:visited {font-weight : bold ;text-decoration : none ;color : #c30 ;}
a :hover {font-weight : bold ;text-decoration : underline ;color : #f60 ;}
a:active {font-weight : bold ;text-decoration : none ;color : #F90 ;}
But you must pay attention to the order when writing. The correct order is: LVHA. If you don't write it like this, the effect may be different from what you expected.

The layout standardization of the middle part and the non-table implementation of the menu require practical guidance, so I won’t write anything here. Let’s write some records about code verification.

XHTML validation common error causes comparison table:
No DOCTYPE Found! Falling Back to HTML 4.01 Transitional--DOCTYPE is not defined.

No Character Encoding Found! Falling back to UTF-8.--Undefined language encoding.

end tag for "img" omitted, but OMITTAG NO was specified--the image tag is not closed with "/".

an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified--the attribute value must be quoted.

element "DIV" undefined---DIV tag cannot be used in uppercase, it must be changed to lowercase div.

required attribute "alt" not specified---The image needs to add the alt attribute.

required attribute "type" not specified---The tag called by JS or CSS misses the type attribute.

CSS2 validation common error causes comparison table:
(Warning) Invalid number: color909090 is not a color value: 909090 ---The hexadecimal color value must be added with a "#" sign, that is, #909090
(Warning) Invalid number: margin-topUnknown dimension: 6pixels ---pixels is not a unit value, the correct way to write it is 6px
(Warning) The attribute scroll_bar-face-color does not exist: #eeeeee --- Define the scroll bar Color is a non-standard attribute
(Warning)Line: 0 font-family: It is recommended that you specify a type family as the last choice--W3C recommends that when defining fonts, it ends with a type of font, such as "sans- serif" to ensure that web fonts can be displayed under different operating systems
(Warning)Line: 0 can't find the warning message for otherprofile--Indicates that there are non-standard attributes or values ​​in the code, check The program cannot determine and provide corresponding warning information
Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template