Diplay: Block problem

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Albert Browne

    Diplay: Block problem

    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


  • Els

    #2
    Re: Diplay: Block problem

    Albert Browne wrote:
    [color=blue]
    > 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:[/color]

    [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 vão. O resto é imperfeito.
    - Renato Russo -
    Now playing: Nelson - Love & Affection

    Comment

    • Lauri Raittila

      #3
      Re: Diplay: Block problem

      in comp.infosystem s.www.authoring.stylesheets, Albert Browne wrote:[color=blue]
      > 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:[/color]

      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:

      Comment

      • Stephen McGrath

        #4
        Re: Diplay: Block problem

        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" <albert.browne@ ntlworld.com> wrote in message
        news:XBfte.2954 6$iy2.22285@new sfe1-gui.ntli.net...[color=blue]
        >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
        >
        >[/color]


        Comment

        • Albert Browne

          #5
          Re: Diplay: Block problem


          "Albert Browne" <albert.browne@ ntlworld.com> wrote in message
          news:XBfte.2954 6$iy2.22285@new sfe1-gui.ntli.net...[color=blue]
          > 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[/color]
          lines.[color=blue]
          > 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.[/color]
          How[color=blue]
          > can I fix this?[/color]


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

          Albert


          Comment

          Working...