'>OneP>Red - Pclass= ' OneBard '>As contrasted with the previous paragraphP>Default Color - Pclass= ' bothOK '>BothP>Blue - Pclass= ' three '>ThreeP>Yellow - Pclass= ' Four '>FourP>Purple -Body>d) specific attribute selectorsSee examples directly:/* Select the src attribute equal to figure or the element starting with figure-*/img[src|= ' figure ']{ border:1px;}4. Document structure-based selectorsA) descendant selectors
There are also differences between the various CSS selectors and the introduction of style sheets. import a style sheet to introduce some pseudo-class selectors and import selectors.
(1) CSS selector:
1. Tag Selector:Select the tag directly using the HTML Tag Name
Pseudo-class selectors for UI elements1.: Focus is used to select the Get Focus event2.: Enabled to specify the style when the element is in the available state3.:d isable used to specify that the element is in a state form that is not available4. When the read-only is used to get the element in a read-only state5. Read-write used to match readable and writable elements input Search6.: Checked to get the style when the radio box is in the selected sta
Usually in the code practice, often use the descendant selector, sub-selectors will also be used, here to do a summary:1, descendants selector and child selector differ:① does not have the same wording:Descendant selectors are identified as: spaces such as: UL li{width:150px;} "between Ul and Li is separated by a space"The child selector is identified as:> such as: ul>li{width:150px;} "> separate
What are CSS selectors? CSS basic selectors include a wildcard selector, a type selector, a property selector, an ID selector, a class selector, a include selector and a sub-object selector, and a special mix of selectors, and then we'll take a look at these
First, CSS descendant selector detailed1, Vivid introduction of basic conceptsA tag is nested B inside another label A, B is the descendant of a.Moreover, the offspring of B are also descendants of a, which is called "children and grandchildren endless also".Like what:Descendant selectors are used to select the descendants of a tag;Adding a "space" between the two selec
Css conquer Selectors 1, Css conquer SelectorsSelectors)
--------------- Refer to css learning in MDN.
First, there are many css selectors, but in general there are two types:
Tag selector ~ Single tag
The name of a single tag.
The 10 most misleading CSS selectors and css selectors
These selectors include first-child, last-child, only-child, nth-child (n), nth-last-child (n) and first-of-type, last-of-type, only-of-type, nth-of-type (n), nth-last-of-type (n ). Among all the
not a word for a computer that contains special characters.
Pseudo class selector (:)Pseudo-class selectors allowed in the CSS2 ruleUse of pseudo-class selectors in CSS3 and support for each browser
Properties
Description
CSS
: Active
Adds a style to the element being activated.
1
The CSS derivation selector allows you to determine the style of a label based on the context of the document. Before you learn to derive, learn the basic CSS selectors. As mentioned in the previous article, the position of the selector is as follows:CSS SelectorDivided into several basic selectors: element selector, I
Sometimes, we can extract the common parts of multiple class selectors or ID selectors, HTML selectors, and write together, so the advantage is that we can simplify the CSS file1. Let's first look at a piece of code. CSS, as follows:@charset "Utf-8";/*
Usually in the code practice, often use the descendant selector, Sub-selectors will also be used, here to do a summary:1, descendants selector and child selector differ:① does not have the same wording:Descendant selectors are identified as: spaces Such as: ul li{width:150px;} "between ul and Li is separated by a space"The child selector is identified as:> Such as: ul>li{width:150px;} "> separate
a
The use of class selectors:
In CSS, the name of a class selector must begin with a dot. This allows the Web browser to find the class selector in the style sheet.
The name of a class selector can contain only letters, numbers, hyphens, and underscores.
The name of the selector must begin with a letter.
Class selectors are case-sensitive.
In
(a) CSS selector:
1. Tag Selector: Select the tag directly from the HTML tag name
2. Class Selector: Select the label with the class attribute added by the name {} of the. Selector
3.ID selector: Select the tag with the id attribute added by the # selector name {}, which is the only one in the HTML document
4. Universal selector: Select all the tags in the HTML document via *{}
5. Descendant selector: Selector 1 (space) selector and select all sub-la
This article brings to you the content is about the CSS pseudo-class selector and pseudo-element selector introduction (with code), there is a certain reference value, the need for friends can refer to, I hope you have some help.
First, link pseudo-class
1. Link pseudo-Class
/* Link pseudo-class * /Note: Link,:visited,:target is acting on the link element!
: Link represents all anchors as hyperlinks and points to a
Article introduction: Semantic CSS combined with smart selectors.
"Structure is always subject to function, which is the constant law," said construction engineer Louis Sullivan, "the father of skyscrapers." Because engineers don't want innocent people to be crushed under huge buildings, this thumbs-up rule is quite useful. In design you should always focus on functionality, and then let the structure appea
Css
Work and web production related, recently sorted out some CSS things, sent out, hope useful.
Reuse:Often use some basic pattern overlays, such as font color and bold. There may be three situations in the Web page: 1. The font is Red 2. Font Bold 3. Font red BoldAt this point we just need to define the first two CSS:. red{color:red;}. B{font-weight:bold;}In th
CSS selectors in the study of CSS is undoubtedly very important, so,
what is a CSS selector? What types of CSS selectors are available? This is what we have to master, and this article will give you a basic definition of
method Cursor:url (Dinosaru.ani); inputtype= "button"name= "Name"value= "I am an old horse, point me, be ruthless." />If I am evil, please remember that I have been pure. ulstyle= "list-style-type:none;padding:0"> Li>Damn, it's getting pretty again.Li> Li>Damn, it's getting pretty again.Li> Li>Damn, it's getting pretty again.Li> Li>Damn, it's getting pretty again.Li> Li>Damn, it's getting pretty again.Li> ul> Tablestyle= "border:1px Red s
I. Summarysummarize the front-end CSS selectors,css inheritance relations,css box model and other related knowledge, and the error-prone areas to analyze the Explanation. second, The reasonIf you don't understand CSS selectors, in
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.