specifying height of a paragraph
How to specify the height of the开发者_开发百科 <p>
tag?
It's easy with CSS:
p
{
height: 100px; /*your measurement and unit*/
}
Since a <p>
element is by definition block, you can assign height, width to it with no problems.
But doing it this way would make all of your <p>
elements in your entire site this height.
You should select it either by its parent (mDiv p {...
or the best way (imo) is by using a class:
<p class="myP">Text</p>
p.myP
{
height: 100px; /*your measurement and unit*/
}
Hope it helps :)
.pclass {
height:200px;
}
<p class="pclass">
some text
</p>
精彩评论