In HTML we often use CSS style to beautify some of the shortcomings of HTML tags, today we say how to use the basic CSS style to change the color of the text, the article is easy to understand, I hope you can practice after reading to deepen the impression.
First, let's show you the basic code of HTML font:
<!doctype html>
Here are the four paragraphs of the p tag, which we should all be able to read, which is the simplest code style. (Want to see more: CSS video lessons)
Second, we want to set the HTML font color, we look at the CSS style code:
<style type= "Text/css" >p{color:blue}</style>
This is the setting in the P tag, which is to put the CSS style in the head tag of the above HTML, and then we can see the effect:
Now we see, is not all changed color Ah, this is the HTML of the paragraph p label parameter style design changes, we changed all the fonts are changed, if we want to change one of the sentence how to do?
Let's look at a complete code:
<!doctype html>
I added a class attribute to the third paragraph, so that the third P tag becomes a class, we can use the class to design its style, and now we set the third P tag yellow, let's look at the effect:
Now we can easily see that the text in the third paragraph becomes yellow, which is not obvious.
Three, CSS style change text color summary:
This is the CSS style we use to set the underlying paragraph properties. We can change the color of this article, of course, we can change the text of the other things, as long as we have this, then a lot of things can be easily understood, the above we also mentioned the class, the class is equivalent to a tag name, of course, this is a public name, a lot of people can use, We can add this name to other labels, so that other labels have the same effect.