CSS ( cascading Style Sheet , overlay style sheet), the function is to beautify HTML Web page.
/* Comment Area */This is the comment syntax
One, style sheet
(i) Classification of style sheets
1. Inline style sheet
Combined with HTML display, the control is accurate, but reusability is poor, redundancy is more.
Example: <p style= "FONT-SIZE:14PX;" > Inline style Sheets </p>
2. inline style sheet
embedded in a Web page as a separate area, it must be written in the head tag.
<style type= "Text/css" >
P//format works on P tags
{
Style
}
</style>
3. external style sheet
Create a new CSS file to place the style sheet. If you want to call a style sheet in an HTML file, you need to right-click in the HTML file to →css the style sheet → attach the style sheet. The link connection method is generally used.
Some labels have default margins, which are usually removed when writing style sheet code (and other styles can be set), as follows:
(ii) selectors
1. Tag Selector. Use the tag name to make the selector.
2.class The selector. It's all about "." start.
3.ID The selector. Start with "#" .
<div id= "style name" >
4. Composite Selector
(1) separated by "," to indicate juxtaposition.
(2) separated by a space, indicating descendants.
(3) filter ".".
Two, style properties
(i) Background and prospects
1. Background:
2. foreground font:
(ii) Borders and borders
Border (table borders, styles, etc.), margin (off-table spacing). padding(content and cell spacing).
(c) List and block
width , Height , ( Top , Bottom , Left , Right ) is useful only in the case of absolute coordinates.
linked to style :
A:link The hyperlink is pre-state.
a:visited Post-click status of Hyperlinks
a:hover when hovering over a hyperlink
a:active When you click the hyperlink
When defining these states, there is a sequence l v H a
HTML style sheet CSS