Before contacting CSS, we used HTML to write the page like this:
<span style= "FONT-SIZE:18PX;" ><! DOCTYPE html>
The results of the operation are as follows:
This kind of Web page flexibility is almost no, if we want to change the page display effect, then we will find the source of the Web site to modify the corresponding place, if there are thousands of such pages, we are such a drip slowly to modify it? No!
The traditional way of writing the content and style written together, with our saying is to write dead, maintainability is really too bad. We should find a way to make the text content and its display of the effect of the definition of separate, when the CSS comes, its biggest feature is to separate the content and style of the Web page, so that the flexibility to modify the page display effect, this is similar to the configuration file we have touched before config. How exactly do you do it? Look down .
The first step is to add a style sheet, as shown in
Then write the following code in STYLESHEET1.CSS:
<span style= "FONT-SIZE:18PX;" >body { font-size:40px; /* Set Font size */ color:blue; /* Set Font Color */ text-decoration:underline; /* Set the font underline */ font-weight:bold; /* Set Font Bold */ text-align:center; /* Set Font to center display */}</span>
We then modify the code in the HTML file:
The results of the operation are as follows:
This is called the CSS technology, by setting the style sheet in the Web page style, to control the page display effect, so if you want to change the display effect, we only need to make the appropriate changes in the style sheet, especially flexible and convenient. Speaking of CSS has to say CSS selectors, according to the video, there are roughly three kinds: class selector, ID selector and HTML tag Selector.
The definition of class selector and ID selector is as follows:
The last kind of HTML tag Selector, if you read the article carefully, then you must know how to use, because the CSS example above is the use of the HTML tag Selector, that is, body{}, curly braces to write the specific style code. About the use of a variety of CSS selectors, will be in the follow-up blog post detailed introduction, here will not repeat, this article mainly tell you what is CSS, give everyone an intuitive and image of the description. Introduction to the CSS of beef brisket