<br/>
Css (Cascading Style Sheets, cascading style sheets) is a page beautification method that achieves the effect of beautifying the page by editing the object properties of Css. The basic unit of operation of CSS is an object. Using CSS feels like using a function in C++/C. CSS objects are like functions, which are used through definition, declaration, and call.
CSS has three selectors (object definition and usage methods): tag selector, category selector, ID selector
CSS has four inclusion methods: inline, embedded, link, and imported
Tag selector:
Definition: referenced style object name {tag attribute: attribute value; tag attribute: attribute value;…….}
eg: h1,h2{text-align: center; color: red } Tag attribute: attribute value; Tag attribute: attribute value;…….} or
. Class name {Tag attribute: attribute value; Tag attribute: attribute value; …….}
Label attribute: attribute value; : center; }
.right{ text-align: right; ;……..
(*Difference: The latter format means that all tags whose class attribute value is the class name comply with the style defined by the class)
(eg: .right{ is defined text-align: right;}, when called, as long as the label with the right attribute is called through class, the right attribute can be displayed.
…
;…; and other tags all show the right-aligned attribute). ID selector:
Definition: #id name {tag attribute: attribute value; tag attribute: attribute value;…….}
eg: #sample{font-family:宋体; don't-size:60pt;}
Use:
……
Inline:
No need to define a selector, use the style attribute to directly style the element
eg:
...
Embedded:
First define the selector and define the style sheet between
. R EG: re<html> <head> <title>xxxxxx</title> <style type=”text/css”> p{color: #000FF;} .info{font-size: 12px;} </syle> </head> </html>
<br/>