css style

css background

 

1 Background

 

p {background-color: color;} //background color
   

 

p {background-color: color; padding: 20px;} //background color, increase padding  
 
body {background-image: url(/i/eg_bg_04.gif);} //settings for background images
  

 2 text

 

p {text-indent: 5em;} // paragraph indent

 

 

p {text-indent: -5em; padding-left: 5em;} //hanging indent, set margin
p {text-align: center} //Center
p{text-align: left} //Left alignment
 
p {text-align: right} // right alignment
 

 

3 fonts

 

body {font-family: sans-serif;} //Set a font, sans-serif is a font.
<span style="font-size: 1em;"> can query css font family. </span>

 

font style

 

p.normal {font-style:normal;} //Text is displayed normally
p.italic {font-style:italic;} //Text in italics
p.oblique {font-style:oblique;} //Text oblique display

 

4 links

 

a:link {color:#FF0000;} //Unvisited link   
a:visited {color:#00FF00;} //Links that have been visited  
a:hover {color:#FF00FF;} //Mouse the mouse pointer over the link  
a:active {color:#0000FF;} // the link being clicked
 

 

5 list

in unordered list

 

ul {list-style-type : square} In an unordered list, list items are marked by dots next to each list.
You can format the logo as you want with the square type.

 

  in an ordered list

 

uo {list-style-type :decimal} ordered list, the sign may be a number or letter,
Then use decimal to set the flag to the format you want.  

 

 6 Forms

Set whether to combine table borders into a single border

 

table
  {
  border-collapse:collapse;
  }
distance separating cell borders

 

 

table
  {
  border-collapse:separate;
  border-spacing:10px 50px;
  }
  the position of the table title

 

 

caption
  {
  caption-side:bottom;
  }
//top default value. Position the table title above the table.
//bottom positions the table title below the table.
//inherit specifies that the value of the caption-side attribute should be inherited from the parent element.
 whether to display cells in the table
table
  {
  border-collapse:separate;
  empty-cells:hide;
  }
//Hide borders and backgrounds on empty cells in the table
//show draws a border around empty cells.
//inherit the value of the empty-cells attribute from the parent element
       

 

 

 

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326743059&siteId=291194637