简体   繁体   中英

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 : 有利润

Another thing is that you missing closing font tag in your code so with margins and closing font tag it will be:

<!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

You can use the margin:auto property. 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>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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