如何在HTML中更改字体大小? [英] How to change font size in html?
本文介绍了如何在HTML中更改字体大小?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想制作一个网站,我想知道如何改变段落中文字的大小。我希望第1段比第2段更大。只要它更大,没关系多大。
我的代码如下:
< HTML>
< head>
< style>
p {
颜色:红色;
}
< / style>
< / head>
< body>
< p>段落1< / p>
< p>段落2< / p>
< / body>
< / html>
解决方案
给他们一个班级, 。
< style>
p {
颜色:红色;
}
.paragraph1 {
font-size:18px;
}
.paragraph2 {
font-size:13px;
}
< / style>
< p class =paragraph1>段落1< / p>
< p class =paragraph2>段落2< / p>
I am trying to make a website and I want to know how to change the size of text in a paragraph. I want paragraph 1 to be bigger than paragraph 2. It doesn't matter how much bigger, as long as it's bigger. How do I do this?
My code is below:
<html>
<head>
<style>
p {
color: red;
}
</style>
</head>
<body>
<p>Paragraph 1</p>
<p>Paragraph 2</p>
</body>
</html>
解决方案
Give them a class and add your style to the class.
<style>
p {
color: red;
}
.paragraph1 {
font-size: 18px;
}
.paragraph2 {
font-size: 13px;
}
</style>
<p class="paragraph1">Paragraph 1</p>
<p class="paragraph2">Paragraph 2</p>
Check this EXAMPLE
这篇关于如何在HTML中更改字体大小?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文