Forum Moderators: not2easy

Message Too Old, No Replies

line-height problem

         

ronak85

6:24 am on Mar 28, 2009 (gmt 0)

10+ Year Member



Hi Friends,
I have developed a page in which user can enter a text in the div and also change its font size and line-height.My problem is when user decrease its line-height less then default line-height then last line's text of div cuts.

Below is the code snippet to describe my problem.

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML Strict//EN">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
</head>
<body scroll="yes">
<div>
<div style="line-height:10px;font-size:20px;width:150px;background-color:Gray;overflow:visible;padding-bottom:auto;height:100%;">
WelCome To ASP.NET Forum
</div>
</div>
</body>
</html>

I am using IE 7.

Thanks in advance !

Regards,
Ronak

simonuk

11:28 am on Mar 30, 2009 (gmt 0)

10+ Year Member



If you use em's or percentages the content should resize correctly.

When you define in pixels some browsers and browser versions take that as a gospel size and will try to stop it from doing anything else.

By using EM's or percentages you're telling the browser it's ok to go with the flow and expand or contract depending on the user.