开发者

Stretching text in div

开发者 https://www.devze.com 2023-03-05 20:03 出处:网络
I have a div w开发者_StackOverflowith width set to 500px. I want the text to be stretched so that it can fit the whole div.

I have a div w开发者_StackOverflowith width set to 500px.

I want the text to be stretched so that it can fit the whole div.

How can this be achieved (if possible) in css ?


You could do something like this.

text-align:justify your p tag


I have found what I was looking for. I can achieve the stretching with the css property:

letter-spacing


Set padding to 0:

div {padding: 0}

If there is something in your div, like <div><p>...</p></div>, add:

div > p {
    padding:0;
    margin:0;
}


Unfortunately, I don't think you can do that with CSS.

0

精彩评论

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

关注公众号