CSS is the abbreviation for cascading Style sheets, with the following basic structure:
<style type = "Text/css" >
selector {
property of Object 1: Property value 1;
Property of Object 2: Property value 2;
}
</style>
Where the selector represents the decorated object, and the property is the style that you want to change. Selectors can be divided into tag selectors, ID selectors, and class selectors.
1 Tag Selector
Suitable for decorating the contents of a class of labels on a page. The syntax is as follows:
Label name {
Property name 1: attribute value 1;
Property Name 2: attribute value 2;
.......
}
{ color:red; Font-size:+; font-family: The song body ; } </style>
Class 2 Selector
Tag Selector decorations are wide-ranging, and you can use a class selector if you want to decorate a specific <li> element individually. The syntax is as follows:
. class Name {
Property name 1: attribute value 1;
Property Name 2: attribute value 2;
.......
}
{Color:Red;font-size: +;font-family:Song Body; }. Blue{Color:Blue; }</style>
3 ID Selector
The id attribute is a unique identifier for an HTML element and requires that the page cannot have duplicate ID identity attributes. The corresponding ID selector is typically used to decorate the HTML element content of the corresponding ID identifier, and the actual application is used in conjunction with </div> as follows:
<DIV id= "ID identification name" >.
The syntax is as follows:
#ID标识名 {
Property name 1: attribute value 1;
Property Name 2: attribute value 2;
......
}
{font-size:14px;font-family:Song Body;width:200px;background:#ccc; }</style>
previously did not contact the CSS, while learning through the blog record, spur their own efforts, at the same time ask the blog park teachers criticize correct and many encouragement, thank you:)
CSS Basic syntax