CSS Series Tutorial-Selector

Source: Internet
Author: User

CSS derivation selectors: a property that defines inline elements within a row of a style sheet or DOM element, and other styles with the same name
The style sheet definition is not valid in other DOM nodes.
For example:
Div ul li{border:1px solid red;}
<div><ul><li> I have a border </li></ul></div>
<span><ul><li> I am borderless </li></ul></span>
After defining the style of the derived selector, the frame property is only for Div ul Li elements, and the span ul li element is not valid.

Cssid selector: The ID selector is the same as the General class selector (that is Class), and can be used to define the style
The name of the table, except that the ID selector starts with the # sign, and the class begins with. In addition, the difference between the two is the id attribute
is unique, and the class attribute can be multiple. If the ID is the same and multiple, it causes the interaction transduction to get the wrong value or
Error. Note
CSS class selector: The CSS class selector is the definition of name that we commonly use in the form of class= "name". Common
. The form of classname.

CSS Property selector: Refers to the selection of one or more elements with special attributes to add specific style sheet properties. If the relative title is included
The element of the property is red or a border is added to all input text edit boxes, so we can define [Title]{color: #f00}
Input[type= ' text ']{border:1px solid red}.

CSS Series Tutorial-Selector

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.