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.
These selectors can only be used after the doc
Css
In CSS, pattern matching rules determine which element of the document tree The style rule applies to. These patterns are called selectors (selector). A CSS rule is a selector {property: Value; property: Value;} (Selector {property:value;property1:value2;} , that is, the selector determines which element the declaration (declaration) in {} matches.
The select
In addition to selecting elements based on the ID (#), Class (.), attributes ([]), the element selector for CSS has an important category, which is to select elements based on their special state. They are pseudo-classes and pseudo-elements. Unlike the ID selector, class selector, property selector, and derived selectors, and so on, these get elements from the HT
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-
. example. pp{ Color:orange;}. example.pp2 { color:green;}
As in the above two definitions one is the middle there are spaces, one is the middle no space.
The first class to write to this effect:
Excuse me, why is this??
. example. PP = E F is a descendant selector.
The. Example.pp2 is an element on which the element includes these two classes to be effective.
There is a difference between the two, there is a big difference!
Example. PP is separate
CSS size: Allows you to control the height and width of the element. Again, you are allowed to increase the line spacing.
CSS classification: Allows you to control how elements are displayed, where the image is displayed in another element, position the element relative to its normal position, use absolute values to position the element, and the visibility of the element.
CSS in the pseudo-class and pseudo-elements are always confused, today reference a lot of information, also looked at some of the documents, now the pseudo-class and pseudo-elements summarized as follows:First, the Origin:Pseudo-class and pseudo-elements are introduced because some information in the document tree can
CSS prepares specific tools for some special effects, which we call "pseudo-classes". Several of which are commonly used, let's look at the four pseudo-classes that are often used to define link styles, namely:
1
:link
2
:visited
3
:hover
4
:active
Because we want to define the link style, it is essential that the anchor t
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.class="c
My previous
Article "
Div + CSSStyle table ID and class naming rules I mainly talked about the naming rules of ID and class. With the foundation of the previous section, what I am talking about today is
Div + CSS style sheet The use principles and skills of ID and Clas in.
First
ID
And
Class
Usage principles
First look at the basic definition:
A composite selector is a selector of two or more basic selectors that are connected in different ways, mainly including the intersection selector, the and set selector, and the descendant selector.
Intersection Selector
The intersection compound selector is composed of two selectors directly connected, and the result is to select the intersection of their respective element ranges. The first of these must be the tag selector, and the second must be a cat
Speaking of CSS Pseudo class, learningWeb Front EndWeb design of the students should not be very unfamiliar with this, many of the previous pages of the special effects are mostly through JS to achieve. But withCSS3continuous development, the use of CSS to achieve Web page effects not only good response, but also reduce a lot of code. Development of Web page code
loading screen with progress indicatorOn the following reference[2] "can find a short and clear revision of the problem of displaying local images in a uiweb View using CSS. To use relative paths or files in UIWebView, you have to load the HTML into the view with the correct base URL parameter. The following example shows how to does this:
12
nsstring *path Span class= "Crayon-o" >= [[ nsb
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 lines of each character in the script, and you can use this class by Css,javascript. So you can use class= "Frodo" on one pag
In the module setup interface and menu item settings interface there are "module class suffix" "Custom module Name CSS Class" and "menu item link CSS class" "target page CSS class" such
This article brings you the content is about in-depth understanding of CSS pseudo-class selector knowledge (code example), there is a certain reference value, the need for friends can refer to, I hope to help you.
Objective
In the past sporadic to understand and use :link , ::after and content other pseudo-class, pseudo-element selector, recently found this lack
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.