Several lessons about CSS

Source: Internet
Author: User

(1) The DIV block cannot be written even if the content is empty.

<Div id = "someid" class = "smomeclass"/>

Otherwise, CSS considers that the DIV is not closed, causing a parsing error. Which of the following statements is true?

<Div id = "someid" class = "smomeclass"> </div>

If you use the xmldocument class of FCL to write an XML file, the DIV of the empty content will be written as an error. To avoid this error, you can add a hidden display content to the div, for example, <HR style = "display: none"/>.

 

(2) Why does the same CSS Tag play a role in some HTML files but not in another HTML file. For example, cursor: Hand. This is because of the html version, which corresponds to the lifecycle of the document. If it is an old version, it works. If it is a new version of xhtml1.0, it needs to be changed to cursor: pointer.

 

(3) The display attribute of the element not displayed is not necessarily none, but may be null. For example

. Myclass {display: none ;}

<Div class = "myclass"> something </div>

 

Although something is not displayed, It is empty when the style. Display attribute is obtained through JavaScript.

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.