By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
431,827 Members | 2,155 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 431,827 IT Pros & Developers. It's quick & easy.

Diplay: Block problem

P: n/a
I am redesigning a web site to use css in place of tables. I am having a
problem with the display: block; statement. With the display: block
statement in place in the navbar div I am getting spaces between the lines.
this can be seen at http://mildenhallgroup.org.uk/newsletter-new.htm With
the display statement removed the spaces go but the lines are not full. How
can I fix this? The navbar css follows:

#navbar{
position: absolute;
top: 100px;
left: 0px;
width: 170px;
padding: 3px;
border: 1px #006633 solid;
}

#navbar ul li a:link, #navbar ul li a:visited {
color: #ffffff;
background-color: #006633;
background-image: none;
border-bottom: solid #ffffff 1px;
padding-left: 10px;
text-decoration: none;
display: block;
font-size: .8em;
}

#navbar ul li a:hover {
color: #ffff00;
background-color: #006633;
background-image: none;
}
#navbar ul li {
list-style-type: none;
margin: 0;
padding: 0;

}

#navbar ul {
margin: 0;
padding: 0;
}
Thanks

Albert
Jul 21 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Els
Albert Browne wrote:
I am redesigning a web site to use css in place of tables. I am having a
problem with the display: block; statement. With the display: block
statement in place in the navbar div I am getting spaces between the lines.
this can be seen at http://mildenhallgroup.org.uk/newsletter-new.htm With
the display statement removed the spaces go but the lines are not full. How
can I fix this? The navbar css follows:


[snip code]

Firefox and Opera don't display spaces.

Try changing your doctype from
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

to

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

so that IE follows (or at least tries to follow ;-) ) the same
standards as the other browsers.

--
Els http://locusmeus.com/
Sonhos vem. Sonhos vo. O resto imperfeito.
- Renato Russo -
Now playing: Nelson - Love & Affection
Jul 21 '05 #2

P: n/a
in comp.infosystems.www.authoring.stylesheets, Albert Browne wrote:
I am redesigning a web site to use css in place of tables. I am having a
problem with the display: block; statement. With the display: block
statement in place in the navbar div I am getting spaces between the lines.
this can be seen at http://mildenhallgroup.org.uk/newsletter-new.htm With
the display statement removed the spaces go but the lines are not full. How
can I fix this? The navbar css follows:


Things work nicely in opera. Your page trickkers quirks more, so it is
hard to quess what is needed for IE. Use doctype decleration mentioned in
spec. It might even be enough to fix it.
See http://hsivonen.iki.fi/doctype/

It is totally broken in Gecko/20041001, don't know why.

--
Lauri Raittila <http://www.iki.fi/lr> <http://www.iki.fi/zwak/fonts>
Utrecht, NL.
Support me, buy Opera:
https://secure.bmtmicro.com/opera/bu...tml?AID=882173
Jul 21 '05 #3

P: n/a
Had the same problem recently. Don't know the reason, but adding this:
height: 1%; after display: block; solved that problem in IE.
"Albert Browne" <al***********@ntlworld.com> wrote in message
news:XB*******************@newsfe1-gui.ntli.net...
I am redesigning a web site to use css in place of tables. I am having a
problem with the display: block; statement. With the display: block
statement in place in the navbar div I am getting spaces between the
lines.
this can be seen at http://mildenhallgroup.org.uk/newsletter-new.htm With
the display statement removed the spaces go but the lines are not full.
How
can I fix this? The navbar css follows:

#navbar{
position: absolute;
top: 100px;
left: 0px;
width: 170px;
padding: 3px;
border: 1px #006633 solid;
}

#navbar ul li a:link, #navbar ul li a:visited {
color: #ffffff;
background-color: #006633;
background-image: none;
border-bottom: solid #ffffff 1px;
padding-left: 10px;
text-decoration: none;
display: block;
font-size: .8em;
}

#navbar ul li a:hover {
color: #ffff00;
background-color: #006633;
background-image: none;
}
#navbar ul li {
list-style-type: none;
margin: 0;
padding: 0;

}

#navbar ul {
margin: 0;
padding: 0;
}
Thanks

Albert

Jul 21 '05 #4

P: n/a

"Albert Browne" <al***********@ntlworld.com> wrote in message
news:XB*******************@newsfe1-gui.ntli.net...
I am redesigning a web site to use css in place of tables. I am having a
problem with the display: block; statement. With the display: block
statement in place in the navbar div I am getting spaces between the lines. this can be seen at http://mildenhallgroup.org.uk/newsletter-new.htm With
the display statement removed the spaces go but the lines are not full. How can I fix this?

Thanks to all that replied .
height: 1%;
fixed the problem.

Albert
Jul 21 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.