What is a style sheet?
CSSYesCascading Style Sheet. It is translated as "stacked style form 」. It is a markup language used to (enhance) control webpage styles and allow separation of style information from webpage content.
How to add a style sheet to Your webpage
You can use the following3.You can add a style sheet to Your webpage. The higher the style definition priority that is closest to the target. The high-priority style inherits the non-overlapping definition of the low-priority style but overwrites the overlapping definition. For exceptions, seeImportantStatement.
Link an external style table File(Linking to a style sheet)
You can create an external style sheet file first (. CSS), And then useHtmlOfLinkObject. Example:
<Head>
<Title> title of article </title>
<LINK rel = stylesheet href = "http://www.dhtmlet.com/rainer.css" type = "text/CSS">
</Head>
InXMLIn the declaration area, as shown in the following example:
<? XML-stylesheet type = "text/CSS" href = "http://www.dhtmlet.com/rainer.css"?>
Define an internal style block object(Embedding a style block)
you can go to your HTML and insert a block object. for the definition method, see style sheet syntax. Example :
<HTML>
<Style type = "text/CSS">
<! --
Body {Font: 10pt "Arial "}
H1 {Font: 15pt/17pt "Arial"; font-weight: bold; color: maroon}
H2 {Font: 13pt/15pt "Arial"; font-weight: bold; color: Blue}
P {Font: 10pt/12pt "Arial"; color: Black}
-->
</Style>
<Body>
Note:,Here we willStyleObjectTypeSet property"Text/CSS",Is to allow browsers that do not support this type to ignore style forms.
Inline Definition(Inline styles)
Inline definition is to use the object within the object tagStyleThe property definition applies to its style table attributes. Example:
<P style = "margin-left: 0.5in; margin-Right: 0.5in">This line has been added with external patches.<P>
Style Sheet syntax(CSS syntax)
Selector {property: Value}
Parameter description:
Selector --Selector
Property: Value --Style Sheet definition. Use colons between attributes and attribute values.(:). Use semicolons between definitions(;)Separate
Inherited Value(The 'herit' value)
Each attribute has a specified value:Inherit. It means that the value of the parent object is equal to the value of the computer. This value is usually used as an alternative. Explicitly declare that it can be emphasized.