简体   繁体   English

如何将段落对齐?

[英]How do I align a paragraph up?

What I want to do is make it so I have one paragraph on the top of the screen and one right under it, but a bit smaller. 我想做的就是制作它,因此我在屏幕顶部有一个段落,在它的下面有一个段落,但是有点小。 But when I execute this there is a big gap in between the paragraphs that I dont want. 但是,当我执行此操作时,我不需要的段落之间有很大的差距。 How do I fix? 我该如何解决?

<!DOCTYPE html>
<html>
<body>
<style>
.p1 {
color: blue;
} 
.p2 {
color: red;
}
</style>
<p class="p1" align="center"><font size="10">Welcome To Plieaxploits!</p>
<p class="p2" align="center"><font size="5" vertical-align="top">We Are The Home 
Of Roblox Exploits!</p>
</body>
</html>

You can set margin:0 for both .p1 and .p2 classes.It will look like something like this : 您可以为.p1.p2类设置margin:0 ,看起来像这样: 有利润

Another thing is that you missing closing font tag in your code so with margins and closing font tag it will be: 另一件事是您在代码中缺少关闭font标签,因此带有边距和关闭字体标签的原因是:

<!DOCTYPE html>
<html>
<body>
<style>
.p1 {
   color: blue;margin:0;
} 
.p2 {
   color: red;margin:0;
}
</style>
<p class="p1" align="center"><font size="10">Welcome To Plieaxploits!</font></p>
<p class="p2" align="center"><font size="5" vertical-align="top">We Are The Home 
Of Roblox Exploits!</font></p>
</body>
</html>

Hope it helps you. 希望对您有帮助。

PS: If not do share what exactly you require and also read this Font tag PS:如果不同意,请分享您的确切要求,并阅读此Font标签

You can use the margin:auto property. 您可以使用margin:auto属性。 Hope this helps! 希望这可以帮助!

<!DOCTYPE html>
<html>
<body>
<style>
.p1 {
color: blue;margin:auto;
} 
.p2 {
color: red;margin:auto;
}
</style>
<p class="p1" align="center"><font size="10">Welcome To Plieaxploits!</p>
<p class="p2" align="center"><font size="5" vertical-align="top">We Are The Home 
Of Roblox Exploits!</p>
</body>
</html>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM