CSS Learning Notes

Source: Internet
Author: User

How CSS is used
    • Style Properties--->
    • Style tag---> Head tag inside
    • Link--->
Three different base selectors for the HTML tag selector:
    • All HTML tags can be used as selectors
    • No matter how deep the label is, it will be selected.
    • Select all labels instead of a specific label
ID selector:
    • Any tag can have an id attribute and a property value
    • ID cannot be duplicated
Class selector:
    • Any label can use the class attribute
    • Class Property name can be reused
    • In a class attribute, you can have multiple class property values
Usage of integrated selectors
    • Descendant selector Div p
    • Intersection selector DIV.D1
    • Set Selector div,p
    • Child element Selector Div>p
    • Sequence selector UL Li:first-child ul li:last-child
    • Neighboring brother selector Div + P
    • Ordinary brother selector Div ~ P
Block-level elements, inline elements, and their differences: block-level elements and inline elements:
    • div block-level elements
    • Span inline elements
Difference:
    • The inline element cannot set the width and height. The width and height of the inline elements are the height and width of the label content. Block-level elements can be set to width and height.
    • Block-level elements are exclusive on one line. The inline element cannot have a single row and can only share one row with other inline elements.
    • If the block-level element does not set the width, the block-level element automatically fills the full width of the parent element.
Inheritance and cascading
    • Inheritance: Some CSS properties of the parent element will inherit the past unconditionally by the quilt element. For example, CSS properties for text can be inherited: Color text-line-font-
    • Cascading: Resolving CSS conflicts. Solve cascading problems by comparing weights.

CSS Learning Notes

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.