Plieax
Plieax

Reputation: 19

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>

Upvotes: 0

Views: 39

Answers (2)

Chandrahas Gaikwad
Chandrahas Gaikwad

Reputation: 201

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>

Upvotes: 0

Mohd. Monis
Mohd. Monis

Reputation: 199

You can set margin:0 for both .p1 and .p2 classes.It will look like something like this : with margins

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

Upvotes: 1

Related Questions