CSS, full name (cascading style Sheets, cascading style sheet), functions to beautify HTML pages.
Basic concept: is a markup language for (enhanced) Control of Web page styles and allows the separation of style information from Web content.
You may be unfamiliar with the term CSS, in fact, whether you use InternetExplorer or
Netscapenavigator surf the web, almost always with CSS, Web pages that do not use CSS may not be easy to find. No matter what work you use,
With the software to make Web pages, are intentionally or unintentionally using CSS. Use good CSS to make your Web pages more concise.
II. Basic Classification
1, inline style sheet (and HTML co-display, control accuracy, but reusability is poor, redundant)
Example: <p > Inline style sheet </p>
The above is a simple inline style sheet, used in <body> tags, the equivalent style attached to the label, only change the label p in the style and formatting.
2. Inline style sheet
Example: <style type= "Text/css" >
P//format works on P tags
{
Style
}
</style>
This is an inline style sheet, that is, the <style> style is extracted separately, placed in
3, external style sheet (obviously, is independent of the HTML file, but still need to call the external style sheet HTML to play its role)
You need to create a new CSS file to store the style sheet separately. When calling this style sheet in HTML, you need to right-click the HTML file---CSS style-attach the style sheet. When the connection succeeds, <link appears in HTML file
4, some labels have default margins, generally write style sheet code will be removed first (you can also set other styles), as follows:
<style type= "Text/css" >
*//format works on all labels
{
margin=0px;
padding=0px;
}
</style>
Third, selector
1. Single Selector
1) Tag Selector---selector with tag name
2) The class selector---all with "." Beginning
3) ID Selector---start with "#"
2. Composite Selector
1) separated by "," to indicate the juxtaposition
2) separated by spaces, indicating descendants
3) filter "."
CSS style sheet Basic concepts