I am styling my <p>
tag to have a certain size, but when I use
<style>
p {
width:200px;
height:200px;
}
</style>
or
<style>
font {
width:200px;
height:200px;
}
</style>
neither of them worked, but it worked when I resized <h1>
and <h2>
. When I looked this up; None of them pertained to text, only iframes, or div(s).
I have tried making them different sizes, but they appear the same. I tried checking the console for errors, but there were none. Here is my code:
body {
background: rgb(25, 45, 35);
}
p {
height: 200px;
width: 200px;
display: inline;
background-color: black;
}
div {
background-color: black;
}
<font>
<b>
Code will be represented with:
<br/>
<p style="color:white;">CODE</p>
<br/>
<p style="color:goldenrod;">KEYWORD</p>
<br/>
<p style="color:yellow;">"Strings"</p>
<br/>
<p style="color:magenta;">Numbers / Boolean</p>
</b>
</font>
<br/>
I expected the <p>
tag to be resized like <h1>
and <h2>
, but it wasn't, why?