开发者

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

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜