How to set font size and font color in css
This article mainly explains "how to set font size and font color in css", interested friends may wish to have a look. The method introduced in this paper is simple, fast and practical. Let Xiaobian take you to learn "how to set font size and font color in CSS"!
In CSS, font size and font color can be set using the font-size and color attributes, just add the "{font-size: font size value;color: color value;}" style to the font element.
Operating environment of this tutorial: Windows 7 system, CSS3 && HTML5 version, Dell G3 computer.
CSS font size font color setting method:
1. Use font-size attribute to set font size
Demo Code:
.demo1{font-size: 20px;}
Examples are as follows:
Document .demo1{font-size: 20px;} .demo2{font-size: 50px;} Text Size 1
Text Size 2
Output:
2. Use color attribute to set font color
Demo Code:
.demo1{color: #FF0000;}
Examples:
Document .demo1{color: #FF0000;} .demo2{color: #0E931C;} Text Color 1
Text Color 2
Output:
At this point, I believe that we have a deeper understanding of "how to set font size and font color in css," may wish to actually operate it! Here is the website, more related content can enter the relevant channels for inquiry, pay attention to us, continue to learn!