开发者

css property to p tag splitting the text when overflow

I am writing content in the p tag in one of the li tag (each li tag consists of 4 p tags).

I am placing the content inside li tag. When it overflows it does not cut the string, it occupies the second p tag space. Please give some suggessions to avoid in both IE and Firefox.

p         p               p             p
........................................开发者_开发问答.................
rajufgsag hjfhf           fdsfg         hdsfghd


Set the overflow setting on the li not the p.


Define a total width on your <li> and then float your 4 <p> tags within that, each with 1/4 of the <li>'s width:

li {
    width: 200px;
}

li p {
    width: 50px;
    float: left;
}

You shouldn't need to use the overflow property at all.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜