<!DOCTYPE HTML><HTML><Head> <Metahttp-equiv= "Content-type"content= "text/html"; CharSet= "Utf-8"> <title>The relationship between HTML and CSS</title> <styletype= "Text/css">H1{font-size:12px;Color:#930;text-align:Center; }
span{
Color:yellow;
}</style></Head><Body> <H1><span>Hello</span> World</H1>
</Body></HTML>
Composition of CSS: selectors, declaring = Attributes and property values
CSS Syntax: selector {property: property value;}
Description: 1) between attribute and attribute value: Connection, declaration must be within curly braces
2) A selector can have more than one attribute, separated by a semicolon between attributes and attributes.
3) A property can use multiple property values, and the property value is separated from the property value by a space
The META tag supports global attributes in HTML.
The Http-equiv property provides a name for a name/value pair. It instructs the server to include a name/value pair in the header of the MIME document to be routed to the browser before sending the actual document.
When the server sends a document to the browser, many name/value pairs are sent first. While some servers send many of these name/value pairs, all servers must send at least one: content-type:text/html. This tells the browser to prepare an accepted HTML document. (Of course, most browsers can now automatically recognize HTML documents.)
Style type= "Text/css" is a CSS format that represents the middle content.
For example: FONT-SIZE:12PX is the size of the control font
Color: #930 controls the colors of the font
Text-align:center is the control text center
The span tag does not have semantics for its purpose in order to set a separate style. In two colors or more, it will choose the bottom color.
Three languages in <!doctype html>
The above are the 3 types of CSS format: 1) inline style sheets are <p style= "color:red;font-size:12px" ></p>
CSS Inline style sheet is the CSS code directly written in the existing HTML tags.
2) embedded style sheet <style type= "Text/css" ></style>
Embedded CSS style is the CSS style code can be written in the style tag. In general, embedded CSS styles are written between 3) Outreach style sheet
<link href= "CSS file address. css" rel= "stylesheet" type= "Text/css"/>
The outer CSS style is to write CSS code in a separate external file, the CSS style file with ". css" as the extension, in
Note: The rel= "stylesheet" type= "TEXT/CSS" is fixed and cannot be modified, and the benefits of using an out-of-the-box style can increase the speed at which the user opens the page.
Three style sheets if they are within the same label, their precedence: inline > Embed > Outreach.
HTML advanced CSS (1)