HTML/CSS basic knowledge, HTML/CSS basic knowledge

Source: Internet
Author: User

HTML/CSS basic knowledge, HTML/CSS basic knowledge

Border: 0; border exists but not realistic and occupies memory

Border: none; the border is not rendered.


HTML writing specifications:

1. line feed. 2. Label indent. 3. Close the tag. 4. The Tag Name attribute cannot be blank. 5. First of all! Doctype declaration. 6. The encoding format is UTF-8. 7. labels must be in lowercase. 8. Reasonable comments. 9. class name. The id name must have a semantic annotation. 10. Reasonably nested.


Relative positioning: relative positioning requires a reference object, but this reference is its own. That is to say, there is no relative positioning position, but the TOP and LEFT parameters can take effect only when it is set, that is to say, only when it is set can it be offset from its original position. The original position is retained, and other layers will be masked after the offset.

Absolute positioning: it is impossible to have absolute positioning in the layout. In any case, there is a reference position. The absolute positioning of the reference position depends on whether its superiors or superiors have positioning, that is, whether there is position: relative. When the layer to be absolutely located is set to the layer with reference to the position, you can use TOP and LEFT to set the position, if its superiors or superiors are not positioned, they will only be located based on the position of the BODY, and the last point is that absolute positioning will lead to element separation from the document stream.

Padding and margin usage: padding: parent and child elements; margin: child elements of the same level. Padding will affect the border. The difference between block elements and row elements: 1. Block elements occupy only one row, while row elements do not occupy one row. 2. You can set the width and height of the block element, but the row element does not work. 3. You can set the margin and padding values for the block element. The Row Element can only set the padding and margin values in the horizontal direction. Common hack in browsers:

"-" Minus signs are IE6 proprietary hack

"\ 9" IE6/IE7/IE8/IE9/IE10 all take effect

"\ 0" IE8/IE9/IE10 all take effect, which is the hack of IE8/9/10

"\ 9 \ 0" only applies to IE9/IE10, which is the hack of IE9/10.


Common Browser kernels and kernel prefixes:

Browser browser kernel browser prefix

Chrome Webkit-webkit (Blink latest)

Opera Presto (latest webkit)-o-(latest webkit)

Safari Webkit-webkit-

Firefox gecko (gecko)-moz-

IE Trifent-ms-


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