Join a community that supports you and your coding journey from day one. We strive to be a friendly, supportive community that empowers everyone to be better developers. By registering with us, you'll be able to discuss, share and private message with other members of our community.
SignUp Now!
Hello Coders!
How do I change a <p> tag font size?
.classname{
font-size:1.2em;
}
.classname{
font-size:15px;
}
.classname{
font-size:5vw;
}
Is it possible to change the font size within HTML document?CSS:.classname{ font-size:1.2em; } .classname{ font-size:15px; } .classname{ font-size:5vw; }
There are so many ways! 1.2em means it will be 20% larger than the default font size for that element. 5vw means 5% of the visible window per character. PX stands for pixels. You can also use the metric system.. example: cm for centimeters
Here is a whole page dedicated to the measurements for font size!
![]()
Yes! You can include that CSS in <style> tags at top of page or do this:Is it possible to change the font size within HTML document?
<p style='font-size:2em;'>hello</p>Yip. It's possible to do that too.Is it possible to change the font size within HTML document?
<p style="text-size: 20px>Hello world!<\p>Code Forum is a community platform where coding enthusiasts can connect with other developers, engage in discussions, ask for help, and share their knowledge with a supportive community. It's a perfect place to improve your coding skills and to find a community of like-minded individuals who share your passion for coding.
We use essential cookies to make this site work, and optional cookies to enhance your experience.