Skillfully Use CSS selector _ Experience Exchange

Source: Internet
Author: User
You can define the link styles in different content blocks by different rules. Similar to this: #nav a:link or #main a:link or #footer a:link. You can also define different styles for the same elements in various content blocks. For example, the styles of #main p and #sider p are defined by #main p and #sider p respectively. Structurally, your pages are made up of pictures, links, lists, paragraphs, and so on, and these elements themselves do not have an impact on what network devices are displayed (PDAs or mobile phones or internet TVs), and they can be defined as any appearance of the presentation.

A carefully structured HTML page is very simple, and each element is used for structural purposes. When you want to indent a paragraph, you do not need to use the blockquote tag, as long as you use the P tag, and the P plus a CSS text-indent rules can be used for indentation purposes. P is a structured label, Text-indent is a performance attribute, the former belongs to HTML, the latter belongs to CSS. (This is the legend of the structure and performance of the separation)

A well-structured HTML page has almost no label that behaves as a property. The code is very clean and concise. For example, the original code , you can now write only in HTML


  • , everything that controls performance is written in CSS, and in structured HTML, table is the table, not anything else (not to be used for layout and positioning). Of course, CSS selectors are not just that simple, except for the ID and class as well as descendant selectors, property selectors, and so on.
    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.