: First-childExample: P:first-child {color:red;} All P elements that are the first child element of an element are set to bold. A common mistake is to assume that a selector such as First-child chooses the first child element of the P element.* Pseudo-classes can be used in combination with the same selector. The binding order is not important, but it is not necessary to put the mutex pseudo-classes togethe
CSS Common selectors: Tag Selector, class selector, id selector, derivation selector, sub selector, combo selector1: Tag Selector: If it is a declaration, you do not need a semicolon, a
CSS Selector detailedSelectors are the core of CSS, from the initial elements, class/id selectors, to pseudo-elements, pseudo-classes, and the richer selectors available in CSS3, to locate any element on the page that begins to become more simple.1. Element SelectorThis is the most basic CSS
Selectors are the core of CSS, from the initial elements, class/id selectors, to pseudo-elements, pseudo-classes, and the richer selectors available in CSS3, to locate any element on the page that begins to become more simple.1. Element SelectorThis is the most basic CSS selector, and the element in the HTML document itself is a selector:p {line-height:1.5em; mar
This article mainly introduces the content related to the CSS selector priority to the coders. It analyzes and compares the CSS selector priority using eight small examples. For more information about the coders, see. This article will share with you the introduction of CSS
---restore content starts---Some of their own simple records, presumably to look at, and then to follow the same model.I've recently written a full and an example of the attributes of each of these examples will be re-posted./*** Browser Private properties*-webkit:chrome,safari*-moz:firefox*-ms:ie*-o:opera** @ rule:* @media: Responsive layout* @keyframes: CSS Animations* @font-face: Introducing external fonts* ...*
border-left, is that clear?When the sweetness tastes, start to re-wash and learn a CSS selector!I divided the CSS selector into three sections, we learn in turn, the first part is that we are the basic selector; The second part is the property
Some of our program apes have some questions about how to apply styles to an element, such as a Div, and why the style I write in the back doesn't cover the previous style, not that CSS is a cascading style sheet?If you also encounter the same problem in development, that is, when you apply a style to an element (such as in an external style sheet), the style that is written on it cannot overwrite the previously defined style. At this point, you may h
You may have mastered the basic css selectors such as id, class, and background selector. But this is far from the whole of css. The following describes the 30 most commonly used selectors in css parsing for your system, including our biggest browser compatibility issue. Only by mastering them can we truly appreciate t
We often encounter this when using CSS to define styles for page elements: apply generic styles to generic elements, and then overwrite them on more specific elements. So how do we make sure that our newly defined element style overrides the original style on the target element? in CSS, the order of the defined style rules is determined according to the particularity of the
selectors, completely ignored: focus. IE7 is supported on any element: hover, but ignored: active and: Focus. If you do not need to be compatible with IE6, IE7, it is very good.Finally, it is worth pointing out that by linking pseudo-classes together, you can create more complex behaviors, such as implementing different rollover effects on both visited and non-visited links. /* makes all visited links olive on hover */ {color: olive;} Universal sele
of the selector is better to take some, the other is not very good to take, jquery in this piece is much better than it, provides a lot of access methods mainly include
1. Base selector (mainly including tag Selector, ID selector, class selector, universal
The CSS selector can accurately find the specified tag. Using the CSS selector allows us to easily define CSS styles for the tag, rather than defining CSS styles for each tag.
The following describes the five most common
1.(1)(2) the. my.css file is as follows:@charset "Utf-8";/*CSS Document*//*the HTML selector*/Body{Color:Orange;}A:link{Color:Black;text-decoration:None;}a:hover{text-decoration:Underline;}a:visited{Color:Red;}/*. Style1 is a class selector*/. Style1{Font-weight:Bold;font-size:20px;Background-color:Pink;Color:Black;}#special_new{Font-style:Italic;Color:Red;}/*#st
CSS basics 5: class selector
I CSS class selector Overview
The class selector allows you to specify styles in a way independent of document elements. This selector can be used independently or in combination with other elements.
T
]
The element that matches the value of the attribute attr that begins with value
E[attr $=value]
The element that matches the value of the Attr property to the end
E[attr *=value]
The value of the match attribute attr contains the element of value
Pseudo-Class selector (CSS tool. All evils incompatible)
E:first-child
Matches the firs
CSS syntaxselector{ Property:value } Example: h1{color:red; font-size:14px} property is greater than 1, the attributes are separated by a semicolon If the value is greater than 1 words, you need to enclose a quotation mark p{font-family: "Sans serif";} Selector grouping: h1,h2,h3,h4,h5,h6{color:red;} Inherited: body{ Color:green; } css-Derived selectorsDefin
CSS (i) Cascading style Sheet Cascading style sheetCSS Annotation Method/* * *First, the introduction of CSS methods1. Row style style= "key:value; " "width:100px;height:100px; Background:yellow; ">2. Page-level CSS is written in the head tag style tag inside the lines (not recommended) [email protected] URL () Introduction also written in the Style tag insi
Some of our program apes have some questions about how to apply styles to an element, such as a Div, and why the style I write in the back doesn't cover the previous style, not that CSS is a cascading style sheet? If you also encounter the same problem in development, that is, when you apply a style to an element (such as in an external style sheet), the style that is written on it cannot overwrite the previously defined style.At this point, you may h
Css selector,(1) element Selector
If you set an html style, the selector is usually an html element, such as p, h1, a, or even html.Html {color: black ;}H1 {color: blue ;}H2 {color: silver ;}
Set styles for elements in xml documents:XML document:
CSS document:
note{font-fam
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.