First, the basic composition of CSS
Selector {property: Property value}
The CSS statement is composed of the above three parts selector written in the curly braces, the curly braces for the declaration, if there are more than one declaration, attributes will be separated by ";" First, let's cite an example:
Body
{
Back
Article Introduction: 11 class with an ID "who has a high priority problem."
Last Friday, before work, our beloved 33 adults also discussed in the group about "11 classes and an ID" who has high priority problem ~_~!
Guess
01
02
03
04
05
10
11
12
13
Body {
Font-size:0.8em;
Color:navy;
}
Above means setting the Font-size font size and color font for the body selector.
So basically, when it works with HTML pages, the text color between the body tag (the contents of the entire window) is Navy font size is 0.8ems.
Length and percentage
CSS has many property values to specify units, but some of the basic units are used on some attributes, before they
corresponding label according to the specified property name, then set the property
[Attribute=value]-Action: Find a label with the specified attribute, and the value of the property equals the tag of value, then set the property-The most common application scenario is to differentiate the input attributeInput[type=password]{}
The value of the property begins with what
[Attribute|=value] CSS2
[Attribute^=value] CSS3
The difference between the two:
Only th
This article mainly introduces the CSS selector grouping related data, the need for friends can refer to the following
Selector grouping
Suppose you want H2 elements and paragraphs to be gray. The easiest way to achieve this is to use the following statement:
h2, p {color:gray;}
A rule is defined by placing the H2 and P selectors on the left side of the rule and
added two sentences: "margin-top: 20px; margin-left: 20px;" changedCopy content to clipboard
Code:
margin:0 auto;
How are you doing? Is the red area in the middle of the browser ~Good ~! At the end of the first lesson, is it very simple or too simple !!! Kwoojan can ensure that the subsequent courses are still very simple. After you finish the tutorial, you will certainly say that XHTML + CSS is so simple!
Body {Font-size: 0.8em;Color: Navy;}The above indicates setting the font-size font size and color font color for the body selector.
So basically, when it works with an HTML page, the text color between the body tag (content in the entire window) is Navy and the font size is 0.8ems.
Length and percentage
There are many attribute values in CSS to specify units, but some basic units are used in some attribu
CSS derivation selectors: a property that defines inline elements within a row of a style sheet or DOM element, and other styles with the same nameThe style sheet definition is not valid in other DOM nodes.For example:Div ul li{border:1px solid red;}After defining the style of the derived selector, the frame property is only for Div ul Li elements, and the span ul li element is not valid.Cssid
> user's normal declaration > browser Default statementSecond, in the developer's statement by the cumulative weight value to determine the priority
Type (high to low)
Weight
Description
Important statement
Infinitely large
!important
Inline declaration
1000
Style
ID Selector
100
#id
class, attribute selection, and pseudo-classes
10
This article mainly introduces how to use jquery to obtain the selector in css. If you need it, you can refer to it and hope to help you.
Before writing, review the differences between elements and nodes:
Element is one of the most widely used nodes in the W3C Document Object Model (DOM.
The element has an associated "attribute ".
The XmlElement class has many methods to access its "attributes" (GetAttribu
of the selector is better to take some, the other is not very good to take, jquery in this piece is much better than it, provides a lot of access methods mainly include
1. Base selector (mainly including tag Selector, ID selector, class selector, universal
In the CSS beginner's tutorial we only consider HTML selectors--appearing as HTML tags.You can, of course, define your own selectors with the class selector class and the identity selector ID.The advantage of doing this is that depending on the class or ID, you can perform the same HTML element differently.In
"alt=" Wkiol1byc6siedymaacophzrvrc869.png "/>Four, pseudo-element selectorPseudo-element: First-letter-: First-letter selector to select the first letter of the specified selector-often used for typesetting details such as initials highlighting, sinking, etc.650) this.width=650; "src=" Http://s2.51cto.com/wyfs02/M01/7D/E2/wKiom1byC32ysFjHAACGOSu3dec073.png "title=" Web.png "alt=" Wkiom1byc32ysfjhaacgosu3de
CSS selector description-link selector and css selector description
Original article: http://www.chinaz.com/web/2012/1017/278553.shtml
I believe everyone is familiar with CSS selector.
Recent projects to write their own front-end, re-learn the basics of the front-end.Generally in CSS style sheets, the above will be overwritten by the following, for example, the text will show Blue:So according to normal, the following CSS style, the test text should still be blueBut as a result, the test text is shown in yellow, the result of the tag Selector i
CSS creates the background:In order to make the style of the Web page more rich, but also in order to let the content and style of the page can be split apart, CSS is born from this idea, CSS is cascading style Sheets acronym, meaning cascading style sheet.With most of the css,html in the style of the label is discarde
First I'll show you how to use the imported CSS style in an HTML page.1. Inline style: 2. In-page style: set in the head tag3, External link method: First you have to prepare a good CSS style sheet outsideNext I'm going to introduce CSS cascading styles like everyoneElement selector: class
Css knowledge (5) -- selector and css knowledge Selector1. Introduction
Starting from this section, we will enter the second part of this series-css and html combination-to put it bluntly, it is the selector.
CSS defines styles. H
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.