In the previous article, we are introducing the five CSS selectors that you must thoroughly understand, and now introduce the other 12 CSS selectors that you need to learn. If you haven't used it, learn it well, if you already know it.First, X:link x:visited x:hover x:active Pseudo-Class
a:link {color:red;}
You may have mastered the basic CSS selectors for the ID, class, background selector. But this is far from the whole of CSS. The following is a systematic introduction of CSS in the most commonly used selectors, including our most headache browser compatibility issues. Maste
Accurate and concise use of CSS selectors will achieve very good results. We don't have to define the class or ID for each element throughout, and with the right organization, you can do the same thing in the simplest way possible. In the actual work, the most commonly used selectors have the following five categories:First, Tag selector:As implies, tag
recommended selector and the most used selector for everyday front-end staff.. error {color:red;}4. X Y (Descendants)Li a {text-decoration:none;}Currently very popular CSS selectors, for the selection of the X element sub-element Y, here is a point to note is that this way the selector will select all the matching sub-elements below, ignoring the hierarchy, so some cases are not suitable for use, such as t
Article Introduction: The best thing about the characteristics of this article is that they solve real-world problems, from trivial and cumbersome selectors to new challenges in building responsive web sites. In fact, I expect every feature to be used in the most mundane projects.
The future of the CSS is so exciting: on the one hand, is a new way of page layout, on the other hand, cool filters,
Excerpt: http://blog.csdn.net/defectfinder/article/details/51734690CSS selectors are also a very useful way to locate elements, even more powerful than XPath. In automation we use CSS selectors to locate page elements it is important to keep in mind a guideline: unique positioning, often using CSS
In CSS, the order of the defined style rules is determined according to the particularity of the selectors, and rules with more special selectors take precedence over rules with general selectors, if the two rules are of the same specificity, Then the rules that are defined in the first precedence we often encounter th
Previous wordsNow, the preprocessor (such as sass) seems to have become standard for developing CSS, just as jquery was developed as standard for JS a few years ago. JS's queryselector draw on the idea of jquery's selector, CSS selectors also draw on the pre-processor variable definition, selector nesting, code block reuse and other common functions. This article
CSS AnnotationsThe CSS modifies all the labels on the page and must be selected with the help of a selector.Selector, you can write many pairs of CSS properties, with {} package;Between each property name and the property value: delimited, many-to-one, must be used;selector {Attribute 1: Attribute value 1;Attribute 2: Attribute value 2;"Naming conventions for
recommended selector and the most used selector for everyday front-end staff.. error {color:red;}4. X Y (Descendants)Li a {text-decoration:none;}Currently very popular CSS selectors, for the selection of the X element sub-element Y, here is a point to note is that this way the selector will select all the matching sub-elements below, ignoring the hierarchy, so some cases are not suitable for use, such as t
Preface: This is the author's understanding and finishing after learning. If there are errors or questions, please correct me, I will continue to update!
Selector weights
If the selector weight is represented by a 4-digit number, then:
The weight of the element selector is 1;
The weight of the ID selector is 100;
The class selector has a weight of 10;
The inline style (also the lines of the JS operation) has a weight of 1000;
Of course if a property value is set! Important,
Various selectors for CSSFirst, the basic selector1. * Universal element Selector, matches any element2. E Tag Selector, matching all elements using e tag3.. info class selector that matches all elements of the class attribute that contain info4. #footer the ID selector to match all elements of the id attribute equal to footerTwo, multi-element combination Selector5. E,f multi-element selector, matching all e elements or F elements, separated by comma
First, Tag selector:As implies, tag selectors are HTML tags that directly use HTML tags as selectors, such as P, H1, DL, strong, and so on.Such as:p {font:12px;}em {color:blue;}DL {float:left; margin-top:10px;}Second, ID selector:We usually define the ID for the page element.such as #menubar {margin:0 Auto;Background: #ccc;Color: #c00;}where "menubar" is the ID name that is defined by itself. Note the "#" n
Quoted from: We all start with the rookieCSS selectors and how to refer to each styleA good interface, is a web to attract people's biggest selling point.CSS: Cascading Style sheets (Cascading style sheets), which defines how HTML elements are displayed.1. Classifier syntax structure for selectors:1.1 ID Selector 1.1.1 Format #id : The id;id of the #+ element is case-sensitive.1.1.2 Example#title1 {Backg
First of all, to get out of your first work, take the second as a encouragement for the future.As a beginner of CSS, it's a bit of a headache to start touching a lot of selectors, especially when you see that the symbol in the style is not the first time to determine which selector it is. First list the currently learned selectors and format: 1, Tag Selector div{
Maybe you've learned three simple and common selectors for CSS: #ID,. class, Tag Selector, but is that enough? With the advent of CSS3 , as the front-end developers need to master the following 30 basic selectors, so that in peacetime development in the heart with the hands.This article will synthesize the 30 CSS3 selectors
containing block.
Right
Defines the offset between the right margin boundary of the anchored element and the right boundary of its containing block.
Bottom
Defines the offset between the margin boundary beneath the anchor element and the lower boundary of its containing block.
Left
Defines the offset between the left margin boundary of the anchored element and the left boundary of its containing block.
Overflow
Sets
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 selector, the third part pseudo class selector!The first part, the basic selector1. Wildcard selector (*)Generally everyone is using *{margin:0;padding:0} more bar,
Learning the Web front-end, the main learning course html5,css,js,ajax Some basic programming language, of course, this is a profound knowledge. And this article is mainly about my choice of CSS in the priority of some simple understanding and views, I hope that your learning to provide some help. Okay, nonsense, let's get started on the subject.CSS Chinese interpretation is "cascading style sheet", here I
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:
[email protected]
and provide relevant evidence. A staff member will contact you within 5 working days.