It appears you have not yet registered with DEVPPL. To register please click here... (it's fast, easy and free!)

Forum

Log In Sponsors
Partner Sites
Board index Programming CSS Forum

line-height doesn't work in IE

line-height doesn't work in IE

Postby aladin on Fri Mar 07, 2008 10:06 am

Hello everyone!

I have many span blocks in div container, they are displayed inline so they go in several lines.
At first i had a problem that distance between lines is to small, so border on each span would overlap. I fixed this in FF with line-height, but i doesn't help in IE7 is there a way to make IE do it, or may be my solution is wrong?

Thanks!
aladin
 
Posts: 3
Joined: Fri Mar 07, 2008 10:00 am

Postby rangana on Fri Mar 07, 2008 10:21 am

The line-height property sets the distance between lines.

A good solution also is to use padding instead.

..if nothing seems to work, could you show us a link to your site, or wrap your codes in;)
~ Get me some work, I do freelancing ~
User avatar
rangana
500+ Club
 
Posts: 929
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines

Postby aladin on Fri Mar 07, 2008 10:27 am

Basically I made an example witch is same as in my page and working with it.
Code: Select all
<html>
<head>
<style type="text/css">

        .divstyle
        { text-align: center;
        font-family: Arial;
        font-weight: normal;
        font-size: 20px;
        color: #404040;
        vertical-align: middle;
        background-color: #fafafa;
        border: 1px #d79900 solid;
        border-collapse: collapse;
        display: run-in;
        padding:4px;
        border-spacing: 0px;
        line-height:30px;
        }

        .spanstyle
        { border: 1px solid #d79900;
        white-space:nowrap;
        line-height:30px;
        }
    </style>
</head>
<body>
<div class="divstyle">
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
<span class="spanstyle"> <input name="cb114" type="checkbox" id="cb114" />114</span>
</div>
</body>
<html>
aladin
 
Posts: 3
Joined: Fri Mar 07, 2008 10:00 am

Postby rangana on Fri Mar 07, 2008 10:35 am

That's basically because you don't have a DTD set in your page.
Add this above the <html> tag:
Code: Select all
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN"
   "http://www.w3.org/TR/html4/strict.dtd">
~ Get me some work, I do freelancing ~
User avatar
rangana
500+ Club
 
Posts: 929
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines

Postby aladin on Fri Mar 07, 2008 10:39 am

:D thanks!
When you get used to that everything is generated for you begin to forget things :].
aladin
 
Posts: 3
Joined: Fri Mar 07, 2008 10:00 am

Postby rangana on Fri Mar 07, 2008 10:43 am

:roll: You should'nt forget a lot of things,,,basically not HTML.

No problem aladin, you're completely welcome ;)
~ Get me some work, I do freelancing ~
User avatar
rangana
500+ Club
 
Posts: 929
Joined: Wed Feb 27, 2008 6:14 am
Location: Cebu City Philippines


Return to CSS Forum

Who is online

Users browsing this forum: No registered users and 0 guests