CSS basic Syntax Simple introduction:
This section introduces the basic syntax of CSS, more suitable for beginners to read, for the slightly experienced personnel, there is little help, can skip.
The main ways to use CSS are the following three types:
1. In-line style 2. Inline style 3. Outer style
Of course, the names in different textbooks may vary, but the substance is the same, not too tangled.
Here are the three ways to use the above separately.
I. In-line style:
The so-called inline style is through the label's style property, the CSS code is written in the tag, the code is as follows:
<style= "Color:blue">softwhy.com</Div >
Advantage is the use of simple, the shortcomings are very obvious, contrary to the principle of separation of performance and content, so it is not recommended to use.
Two. Inline style:
The inline style is to say that the CSS code is written to the <style> tag, the code is as follows:
<styletype= "Text/css">Div{font-size:12px;Color:Green;}</style>
Usually the <style> label should be placed in the head, but can also be placed in other places. The application of this method is also very simple and convenient, but if the CSS code more, it will make the page very large.
Three. Outreach Style:
The outer style is to introduce a CSS file into the current page with the following code:
<rel= "stylesheet" type= "text/css" href= " Style.css "/>
This is recommended when there is more CSS code.
Four. Common selector:
Of course there are many popular selectors, because this chapter is for beginners, so introduce the most basic and commonly used selectors.
1.HTML Tag Selector 2. Group selector 3. Include selector 4.Class selector 5.ID Selector
Here is not introduced, you can refer to the relevant articles can be.
Related reading:
1. The tag selector can be found in the CSS type selector (E) section.
2. The group selector selector can be found in the section on selector grouping for CSS .
3. The Include selector selector can refer to the include selector (E F) section of the CSS .
The 4.class selector can be found in the class selector section of CSS .
The 5.id selector can refer to the ID selector section of the CSS .
The original address is: http://www.softwhy.com/forum.php?mod=viewthread&tid=15647
For more information, refer to: http://www.softwhy.com/divcss/
CSS basic Syntax Simple introduction