Web2.0 under the XHTML+CSS design need to pay attention to the local summary _ Experience Exchange

Source: Internet
Author: User
Tags comparison table dashed line
Precautions:
1. Statements other than select DOCTYPE must be written in lowercase English letters. This includes mouse actions generated by Macromedia Dreamweaver, such as OnMouseOver, which must also be modified to OnMouseOver.

2. The XHTML language regulations require that all logos must have a start and end. For exampleAnd、

And

, for an unpaired identity, ask for a space at the end of the logo, followed by a "/". For example
Written
, write, add a space reason is to avoid the code connected to the browser is not recognized.

3. All XML tags must be nested appropriately. Such as:

Must be modified to:

, which means that a layer of nesting must be strictly symmetrical.

4. All attributes must be enclosed in quotation marks "". Such as: Must be modified to: 。 In special cases, you need to use double quotes in the attribute values, you can use ", single quotes can be used," for example:.

5. Put all <和&特殊符号用编码表示。如:任何小于号(<),不是标签的一部分,都必须被编码为& l t ; ,任何大于号(> ), not part of the label, must be encoded as & G T; , any number (&), not part of the entity, must be encoded as & a M p;. (no space between the above code letters)

6. Assign a value to all attributes. Such as: Must be modified to: 。

7. Do not use "--" in the annotation content. Such as: You can replace the inner dashed line with an equal sign or a space 。

The first is the specification of the header section of the file:

CODE:










[Copy to Clipboard]



In terms of the definition of CSS, it is recommended that a common font setting scheme is as follows:
CODE:
Body {font-family: "Lucida Grande", Verdana, Lucida, Arial, Helvetica, song Body, Sans-serif;}
[Copy to Clipboard]


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

Lucida Grande fonts are suitable for Mac OS X;

Verdana fonts are suitable for all Windows systems;

Lucida for UNIX users;

"Song body" suitable for Chinese simplified users;

If the fonts listed are not available, the default Sans-serif font is guaranteed to be called.


CSS uses four pseudo-classes to define the style of the link: 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 when writing, be sure to pay attention to the order, the correct order is: LVHA, if not, it is likely that the effect is not the same as you expected.

The middle part of the layout normalization and the non-tabular implementation of the menu requires a hands-on guide, not what to write here first. Write a note about code validation below.

XHTML Checksum common error cause comparison table:
No DOCTYPE found! Falling back to HTML 4.01 transitional--undefined doctype.

No Character Encoding found! Falling back to utf-8.--no language encoding is defined.

End tag for ' IMG ' omitted, but Omittag no is specified--picture label does not add "/" off.

An attribute value specification must be a attribute value literal unless Shorttag YES is specified--property value must be quoted.

The element "div" Undefined---div tag cannot be capitalized and changed to lowercase div.

Required attribute "alt" not specified---picture requires ALT attribute.

Required attribute "type" not specified---js or the tag of the CSS call is missing the type attribute.

CSS2 Check common error causes comparison table:
(warning) Invalid number: color909090 is not a color value: 909090---Hexadecimal color value must be "#", i.e. #909090
(warning) Invalid number: Margin-topunknown dimension:6pixels---Pixels is not a unit value, correct notation 6px
(warning) Property Scroll_bar-face-color does not exist: #eeeeee---Define the scrollbar color is a non-standard property
Warning line:0 font-family: It is recommended that you designate a family section as the last option--w3c suggest font definitions, end with a category of fonts, such as "Sans-serif", to ensure that the page font 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 that the validator cannot judge and provide the appropriate warning message
  • 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.