Flexible Font Size for fixed width and height

I need to make each of my `

` have flexible font size with fixed width and height. Current code CSS p{ width:500px; height:100px; background-color:#F0F0F0; margin:10px; padding:5px; font-size:24px; } HTML

Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis pharetra quis dui a laoreet. Proin nibh dolor, faucibus sit amet aliquet ac, varius id eros. Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis pharetra quis dui a laoreet. Proin nibh dolor, faucibus sit amet aliquet ac, varius id eros. consectetur adipiscing elit. Duis pharetra quis dui a laoreet. Proin nibh dolor, faucibus sit amet aliquet ac, varius id eros.







Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis pharetra quis dui a laoreet. Proin nibh dolor, faucibus sit amet aliquet ac, varius id eros, faucibus sit amet aliquet ac, varius id eros.




Lorem ipsum dolor sit amet, consectetur adipiscing elit. Duis pharetra quis dui a laoreet. Proin nibh dolor, faucibus sit amet aliquet ac, varius id eros.

Check and try the code in jsfiddle http://jsfiddle.net/8GNAV/ And this the output I want to reach http://jsfiddle.net/8GNAV/1/
Can you clarify a bit more for us? What do you mean 'flexible font size'? Are you asking how to create fixed sized 'boxes' with variable lengths of type but you always want the type to completely fill the box?

以上就是Flexible Font Size for fixed width and height的详细内容,更多请关注web前端其它相关文章!

赞(0) 打赏
未经允许不得转载:web前端首页 » JavaScript 答疑

评论 抢沙发

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址

前端开发相关广告投放 更专业 更精准

联系我们

觉得文章有用就打赏一下文章作者

支付宝扫一扫打赏

微信扫一扫打赏