CSS style, css
CSS basic style
- Inline Style: Directly use the HTML-tagged style attribute in the page file. For example:
<P> <style type = "text/css"> h1 {font-family: ""; font-size: 12px ;}# fromid {font-family: ""; font-size: 12px ;}. classid {font-family: ""; font-size: 12px ;}</style>
- Embed an external style sheet in the page file:Syntax:
<Style type = "text/css"> @ import url ("external CSS style file name"); <! -- The external file name is a CSS file with the extension .css. If the file is in the same directory as the current page, the file name is used directly. If the file is not in the same directory, the relative path is given. -> </Style>
- Link external style sheet:Syntax:
<link type="text/css" rel="stylesheet" type="text/css" href="css/index.css"/>
CSS annotation Syntax:The CSS annotation statement is located
/* */
Statement content between tags
CSS Selector
H1 {font-family: ""; font-size: 12px;}/* in the HTML document, all text protected by this tag has a defined CSS style */
. Classid {font-family: ""; font-size: 12px;}/* in the HTML document, all tags marked with such names have defined tags */
# Fromid {font-family: ""; font-size: 12px;}/* in the HTML document, all tags specified as this ID have defined tags */
CSS style priority