Class SelectorIn CSS, the class selector is displayed with a point number:
Copy Code code as follows:
. 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 e
Core Tip: first understand the pros and cons of IDs and class. So that they can be used according to their own characteristics.
Which one do you want to use for ID and class?The first thing to understand is the pros and cons of IDs and class. So that they can be used according to their own characteristics.
Advantages of ID (
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
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-
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
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
distance from the outer border,6, the border size fixed after the increase of Padding, and then change the original border size, is for div right and bottom operation, the change is the left and the bottom of the distance.7, padding of the various situations, the element is supported in the line, margin line elements only support around, not support up and down.8, positioning (absolute positioning, relative positioning)A: Absolute Positioning Position:absoluteA.1 when the position is set to abs
the form's top left-right bottom.2. Relative positioning positon:relative(1), when set to relative positioning when not out of the document flow, will be affected by the float (float).(2), when set to relative positioning, the azimuth (top left right bottom) is relative to the parent tag of the element, because the label is not separated from the document flow so that the label around it is occupied position.3, fixed positioning positon:fixed(1), when set to fixed positioning, out of the docume
IDS can only be used once in a Web page. Of course, even if an ID is used more than once in a Web page, its CSS style can still be implemented, but the general rules of the universal standard are used once. Because ID in HTML can give HTML tags special attributes such as JS action, table conveys values and so on characteristics so different from a class can use how many times, and a
Original: jquery modifies class attributes and CSS stylesjquery modifies class attributes and CSS stylesClass Property Modificationthe Class Property is the Class property, which specifies the name of the category.when specifying
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
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
jquery modifies class attributes and CSS styles Class Property Modificationthe Class property is the Class property, which specifies the name of the category. when specifying a style with a class selector, you need to specify the
Objective
In the past sporadic to understand and use :link , ::after and content other pseudo-class, pseudo-element selector, recently found this lack of reading, so decided to study a little bit, the following is the pseudo-class part of the collation.Pseudo class
Pseudo-class selectors essentially allow designers to
css| Keywords | Web page
Because the project to write the document structure, write CSS more people, and work with the programmer, you need to unify the name of class and ID, the day before yesterday spent a little time, according to most people's habits, developed the following commonly used keywords:
Container: Container/box
Head: Header
Main navigation: Ma
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
An element can have both an ID selector and a class selector, but only one ID selector, and the ID selector has a precedence greater than the class selector.
Cases:
HTML file Contents:
Contents of Test.css File:
/* An element can have both an ID selector and a class selector.
#id1 {
Background-color:silver;
font-size:40px;
Color:black;
}
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.