The pseudo class of CSS, css
1.
: Link: Add styles to unaccessed links
: Visited adds a style to the accessed Link
: Hover: Add a style to the element when the mouse is hovering over the element
: Active adds a style to the activated element (clicked)
When the above four pseudo classes are used for hyperlinks, a: hover must be after a: link and a: visited, a: act
You can define your own selectors with class selector classes and identity selector IDs.
The advantage of this is that depending on the class or ID, you can perform the same HTML elements differently.
In CSS, the class selector precedes a half-width period (.), and the ID is preceded by a half-width English pound s
The class in CSS is designed to facilitate filtering (that is, selecting) elements to add styles to such elements, which are defined in the HTML document tree.But this is not enough in some cases, such as the user's interaction (hover, activation, etc.) can cause the state of the element to change, class is powerless for these dynamic changes.For this reason,
, 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
. (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
CSS: Cascading style sheet cascading ( [kæ ' Ske?d??] cascading) style SheetCSS BASIC Syntax structure: selector {attribute: value;attribute: value;...}Three main selectors:Tag Selector:A selector named after the HTML tag that directly controls the corresponding labelP{font-size:16;}Class selector:Add the class attribute to the tag, and the selector name is "."
: Before: The function of After is to insert an inline element containing the content specified by the content property before or after the specified element contents (not the element itself), with the following basic usage:#example:before { content: "#"; color: red;}#example:after { content: "$"; color: red;}This code inserts a ' # ' before the content of the #example element, and adds a ' $ ' after the content, and the inserted inline element is the child of the #example, with the
css| Specification | A normalized web developer can identify the div and other formatting page elements by creating the class and ID names of the CSS and using those names. For developers, when naming CSS selectors for redefining XHTML tags (tags), you must ensure that they match exactly the predefined tags, but in ter
CSS pseudo-classes are used to add special effects to certain selectors.CSS Pseudo-class (pseudo-classes) instances:
Hypertext links
This example shows how to add a different color to a hyperlink in a Document.
Hyperlink 2
This example shows how to add additional styles to Hyperlinks.
Hyperlinks-: Use of focus
This example shows
standard usage in Web page making Div+css naming rules that can improve the effectiveness of optimization especially when teamwork can provide collaborative production efficiency, specific DIV CSS Naming conventions css naming encyclopedia content article. Common div+css named Daquan collections, which are
JQuery modifies class attributes and CSS styles, and jquerycssJQuery modifies class attributes and CSS stylesClass Attribute ModificationSpecifies the class name. when specifying a style with the class selector, you must specify t
A class is used to define one or more elements based on user-defined criteria. A more appropriate analogy is the script: A class can define the story line for each character in the script, and you can use it through css,javascript. So you can use class= "Frodo" on one page, class
element*/abbr,acronym{Border:None;font-variant:Normal;}/*consistent del style*/del{text-decoration:Line-through;}Address,caption,cite,code,dfn,em,th,var{Font-style:Normal;Font-weight: -;}/*Remove the identification before the list, and Li will inherit*/Ol,ul{List-style:None;}/*alignment is the most important factor in typography, so don't let anything get centered.*/caption,th{text-align: Left;}/*from Yahoo, let the title be customized, adapt to mult
The word "CSS" is so strange that it seems to me more like a label that identifies a particular state.
And the classes in the program.
Pseudo-Class with: Following the selector, identifies some states
:: Indicates CSS3 some new pseudo class, the suggestion all uses::. I don't support CSS3 's browser this year.
Examples of these pseudo classes:
Link links are
CSS Id and Class selectorIf you want to set CSS styles in HTML elements, you need to set the "id" and "class" selectors in the element.One, ID selectorThe ID selector can specify a specific style for an HTML element that is labeled with a specific ID.The HTML element sets the ID selector with the id attribute, and the
In the process of learning CSS, it is particularly easy to confuse the two concepts:
pseudo-class and pseudo-elements。 The definitions of the two are as follows:
CSS pseudo-classes are used to add special effects to certain selectors.
CSS Pseudo-elements are used to add special effects to certain selectors.
The pseud
; Divclass= "Left">Left Fixed widthDiv> Divclass= "Right">Right Width adaptiveDiv>Div>The tutorial mentions the two-column adaptive layout scheme:4,the relationship between overflow and Position:absolute:4-1-1, the parent element already has the Overflow:auto attribute, and adding the Position:absolute attribute to the IMG in the diagram will invalidate the scrollbar and the picture does not move with the scroll bar.4-1-2, the parent element has the Overflow:hidden property, and then adds
Pseudo-Class in 1.CSS
CSS pseudo-classes are used to add special effects to certain selectors.
Grammar:selectorpseudo-class{property: value}CSS classes can also be used in conjunction with pseudo-classesselector.class: pseudo-
This article mainly explains how to modify the class attributes and CSS styles of jQuery. For more information, see.
Class Attribute Modification
Specifies the class name.When specifying a style with the class selector, you must specify the
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.