In CSS, the class selector is displayed with a dot number:
. Center {Text-align:center}In the example above, all HTML elements that have the center class are centered.
In the following HTML code, both the H1 and P elements have the center class. This means that both will adhere to the rules in the. Center selector.
*****************************ID SelectorThe
. (This is self-understanding, unofficial explanation).
Language pseudo-Class selector:E:lang (language): Selects all elements that match E, and the matching element has the lang attribute, and its value is language.There are two ways to set up a document language. First, if you use HTML5, you can set this:or manually specify in the document:lang= "fr">
UI element State pseudo-class selector:E:checked: Matches a selected check button or radio button FORM elementE:enabled: Match all enabled
CSS: id selector, cssid Selector
This article describes the basic usage of the id selector in css: setting attributes for a specific TAG content.
Code organized from w3school: http://www.w3school.com.cn
:
Css pseudo-class selector creates a login box form, Selector
When a pseudo-class selector is used to make the mouse hover, the text box appears orange dotted line border. When the mouse is activated, the background color becomes pale orange.
Use css to create a rectangle wi
Descendants are selected with spaces, such as a b{border:1px solid red;}A descendant selector, such as a>b{border:1px solid red;}But if you think about it, these two concepts are not a duplicate of the place,are descendants also descendants?are descendants not descendants?The relationship between the two is not discussed, so let's see what's different in CSS.First on the code:Descendant selector:Descendant selector:It can be said that the difference i
A Brief Introduction to the after pseudo object selector of css, cssafter pseudo Selector
A Brief Introduction to the after pseudo object selector of css:This section describes the usage of the after pseudo object selector, hoping to help you.Before this
The selector (selector) is a very important concept in CSS, and the markup styles in all HTML languages are controlled by different CSS selectors. Users only need to choose different HTML tags to choose, and give a variety of style declarations, you can achieve a variety of effects.CSS selectors include: Tag
+ Left padding + content + right padding + right Border + right edgeProperties of the CSS box model :Content properties: Wide =width high =heightInner padding attribute (distance between content and border): paddingMargin properties: Margin (note browser compatibility when using this property)Rules for inner padding and boundaries:If there are four parameters: the upper right or lower left, you can specify a direction aloneIf there is only one argume
1. style sheet Cascading Style SheetCSS Benefits:
Separation of content from performance
Web page performance is unified, easy to modify
Rich styling to make Web page layouts more flexible
Reduce the amount of Web page code, increase the browsing speed of Web pages, save network bandwidth
Use Web-independent CSS to facilitate web pages to be indexed by search engines
Embed id> external id> embed class> external class> embe
In CSS, the class selector is displayed with a point number:
. Center {Text-align:center}
In the above example, all HTML elements that have the center class are centered.
In the following HTML code, the H1 and P elements all have the center class. This means that both will comply with the rules in the. Center selector.
*****************************
ID
CSS: class selector, cssclass Selector
This article describes the basic usage of class selectors in css: setting attributes for tags of the same type.
Code organized from w3school: http://www.w3school.com.cn
:
What is a CSS selector? The CSS selector is the tag that specifies the CSS to function, and the name of the tag is the selector. means: Select which container. Elements in an HTML page are controlled by a
This article is written in notes form.1, CSS class selector detailedHttp://www.w3school.com.cn/css/css_selector_class.aspKnowledge Points:(1) The premise of using class selector is to add a class attribute to the tag, such as (2) The syntax of the class selector is: *.import
When using CSS or jquery to select elements. Very often we need to make a or | | Operation.jquery or CSS | | Operations are often used. Also very easy, is separated by commas.Selector1,selector2,selectornFor example, if we want to select a div or span, we can select the element that satisfies the condition by $ ("Div,span"). in CSS or jquery. Most of what I've
Css: nth-of-type () selector usage, nth-of-type Selector
I made a page today and accidentally saw thisnth-of-typeIt is quite convenient. Some of the previous single and double lines have horizontal lines, and some do not have horizontal lines. Generally, border-right: none and so on are separately written in html. Now we can quickly record this good thing.
: Nth-
, the parent element contains only one child element, and the child element matches E.11:e:only-of-type, the selection parent element contains only one child element of the same type, and the child element matches the E12:e:empty: Selects an element that has no child elements and does not contain a text node.
Negation pseudo-Class selector:E:not (f), matches all E elements except F.
Property selector:1.E[ATTR]: Select match E element with attr att
neighbor Sibling Selector adjacent brothers, which must be strictly adjacent , are not allowed to appear other element intervals -->through the sibling selector all siblings do not require strictly adjacent --> CSS Selector--adjacent, universal sibling selector
Town Field Poem:The Pure Heart sentiment wisdom language, does not have the world name and the benefit. Learn water under the hundred rivers, give up arrogant slow meaning.Learn to have a small return to feed root, willing to cast a conscience blog. Sincere in this writing experience, willing to see the text to inspire.——————————————————————————————————————————CodeResult——————————————————————————————————————————The essence of the blog, in the technical part, more in the town yard a poem. Editor
Learn the CSS selector this week.The most commonly used work is the element selector, the ID selector, the class selector, and the descendant selector.There are some less common but powerful selectors are easy to overlook, this study summarizes.1. Descendant
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.