1. Element Selector
2. Class Selector
3. ID Selector
4. Attribute Selector
5. Derivation Selector
1. Element SelectorThe most common CSS selector is the element
This article introduces the usage and summary of the CSS3 selector, including General selectors, attribute selectors, pseudo-class selectors, and the code farmers interested in CSS selectors can read this article.A universal Selector1 *{} wildcard selector (CSS2): Fits all element objects.2 e type (HTML) selector (CSS1
This section is primarily a new selector for CSS3Next CSS (CSS3) selector (1)I. General Brotherhood selector::e ~ F, matches the sibling F element after any e element.div ~ p{ Background-color: #00FF00;}Two. Property selector::E[att ^= Val], matches the attribute of the A
1. IntroductionStarting with this section, you'll enter the second part of this series,--CSS and HTML, which is plainly the selector.CSS defines the style, how to set these styles to the appropriate HTML node? You have to pass the selector. Let the browser know which DOM node the CSS chooses, and the browser will render the corresponding style as a view.The third
You may have mastered the basic CSS selectors for the ID, class, background selector. But this is far from the whole of CSS. The following is a systematic analysis of the 30 most commonly used selectors in CSS, including our most headache browser compatibility issues. Mastering them, you can really appreciate the great
CSS style selectors are divided into 4 levels, A, B, C, D, which can be used to determine the precedence of CSS selectors based on these four levels.1. If the style is in-line style (defined by style= ""), then a=12.B is the total number of ID selectors3.C is the number of class selectors.4.D is the number of type selectors5. Property selectors, pseudo-class selectors and class
1. Element Selector
2. Class Selector
3. ID Selector
4. Attribute Selector
5. Derivation Selector
1. Element SelectorThe most common CSS selector is the element
ten
8
Div p{}
0,0,0,2
2
9
p{}
0,0,0,1
1
In line 4 is not the descendant selector, Div and #id are next to each other, that is, the ID is the ID of the Div, before I do not know, the weight of this selector is based on an ID selector, or an ID an element, after testing,
The tag selector is actually a tag in the HTML code. such as P{font-size:12px;line-height:1.6em;}The effect of the above CSS style code: Set the 12px font size for the P tag, and the line spacing to set the 1.6em style.Class SelectorClass selectors are most commonly used in CSS style encodings, such as the code in the right-hand code Editor: can be implemented as
certain properties, you can further narrow down the selection, selecting only the elements that have specific attribute values.Example 1For example, suppose you want to turn a hyperlink that points to a specified document on a WEB server into red, so you can write:{color: red;}Example 2Like a simple property selector, you can link multiple Property-value selectors together to select a document.{color: red;}This changes the text of the first hyperlink
1. IntroductionStarting with this section, you'll enter the second part of this series,--CSS and HTML, which is plainly the selector.CSS defines the style, how to set these styles to the appropriate HTML node? You have to pass the selector. Let the browser know which DOM node the CSS chooses, and the browser will render the corresponding style as a view.The third
Using CSS
1,css is a cascading style sheet (cascading style Sheet), consisting of a selector and a declaration block. The first section below H1 is the selector, and the curly braces surround the block that is the declaration block.{ color: red;}2,css use is mainly
Intersection selector and the set selectorIntersection Selector
1, function: To all selectors selected in the label, the intersection of that part of the label set properties2. Format:Selector 1 Selector 2 {attribute: value;}3. Note:1. There is no link symbol between selector and selector2.
css| Beginners | Web page
Wildcard Selector
Grammar:*DescriptionSelect a single object for all types in the document tree (DOM).If the wildcard selector is not the only component of a single selector, "*" can be omitted.Currently, ie5.5+ does not yet support this type of selector.Example:*[LANG=FR] {font-size:14px; wid
Last year when I was learning jquery, I used to have a little selector (selector) notes.
These days took out a look, found a lot have forgotten. So, I decided to post them here for easy viewing later. This should also be useful to other friends, after all, the selector is the first step to make the page effect.
The notes are divided into two parts, today is the
Note is divided into two parts: Today is the CSS selector, and later there is a part of the XPath selector. Today's note contains 44 selectors, basically covering all the rules of CSS 2 and CSS 3.
==================================
CSS
CSS basics 4: Element Selector
In the previous blog, we were familiar with CSS syntax and had some knowledge about CSS code formats. The CSS code is as follows:
Selector name {attribute name: attribute value ;......}
The attribute
CSS selector: 1. Basic selector 2. Advanced SelectorThe basic selector contains:1. Tag SelectorTag Selector can select all of the label elements, such as Div,ul,li, p, etc., regardless of how deep the tag is hidden, can be selected, select All, not one, so say "commonality"
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.