<ul> tag

They have: 117 posts

Joined: Feb 2000

Hello,

This is a nit, I'm sure, but it's annoying. When I use the

    tag, i.e.

Some text:

    first item
  • second item

Netscape seems to put an extra line between the "Some text" and "first item". This does not happen with IE. Is there any way to avoid this extra line being inserted with Netscape? Thanks for any help.

Bob

Jack Michaelson's picture

He has: 1,733 posts

Joined: Dec 1999

try:

Some text:

  • first item
  • second item

I didn't test it, but it was the first thing that popped up in my mind Smiling

Hope it helps,

Vincent Puglia's picture

They have: 634 posts

Joined: Dec 1999

Hi,

If you want no empty lines between any of the text, kill the

    tags

Vinny

Suzanne's picture

She has: 5,507 posts

Joined: Feb 2000

For valid code, please use the

    around the

  • tags, and use CSS to change the spacing between the elements.

    ul {margin-top: -1em;}

    The amount you change the spacing to will depend on the size of your fonts, of course.

    Smiling Suzanne

    Vincent Puglia's picture

    They have: 634 posts

    Joined: Dec 1999

    ouch, Suzanne Wink

    I defer to your better control over text flow Laughing out loud

    Vinny

    They have: 117 posts

    Joined: Feb 2000

    Jack, Vinny, Suzanne,

    Thanks for all the replies.

    Jack, unfortunately, your idea did not work.

    Vinny, I've used your idea before. It works fine, except without the

      tags, it does not format the list quite as nicely (if text on an
    • wraps to the next line, it starts it under the "." rather than indented under the text on the line above.

    Suzanne, your idea using CSS worked fine in Netscape - did exactly what I was looking for. The only problem is with IE it causes "first item" to be overlaid on top of "some data". Is there a way to get it to work with both Netscape and IE? Thanks again.

    Bob

    Suzanne's picture

    She has: 5,507 posts

    Joined: Feb 2000

    Well, in Netscape 6, Opera 6, IE 5 & 6, you should have the same results with a little less of a variance in the margin, like -.5em instead.

    What you can do is set it to -1em in the linked stylesheet for Netscape 4.x, then over-ride that with -.5em in the imported stylesheet, which will make it work for the newer browsers.

    Short of that, you can go for somewhere in the middle as far as sizing goes, like -.75em, ha!

    It will also depend on what else you are doing, of course, in your CSS.

    I'd recommend poking around alistapart.com and checking out their stylesheets if you are looking for real life examples and webstandards.org has a page on how to have the best of both worlds (supporting standards AND lower browsers at the same time).

    Smiling Suzanne

    P.S. To Vinny -- some people don't give a hoot as to valid code, and some do, so I was just providing the other side of the coin. Wink

    Vincent Puglia's picture

    They have: 634 posts

    Joined: Dec 1999

    Hi Suzanne,

    Point well taken. As a general rule, I agree. However, when it comes to 'prettyfication', I'm somewhat lax. Guess that's why I consider myself a coder and not a designer and wear Lees and Levis and not Ralph and Tommy Laughing out loud

    Vinny

    Where the world once stood
    the blades of grass cut me still

    Suzanne's picture

    She has: 5,507 posts

    Joined: Feb 2000

    That typography isn't "prettification", but rather an essential communication tool, but I'd probably lose!

    Wink Suzanne

    They have: 117 posts

    Joined: Feb 2000

    Suzanne,

    I tried playing with different values for em, but still could not get it to work correctly with both browsers. However, I added a in front of the first

  • and it now works OK with both NS and IE.
  • ul {margin-top: -.75em;}

    Some text

    • first item
    • second item

    It's a little tighter on IE than I would like, and a little wider on NS than I would like, but definitely better overall than before. Not sure exactly why this worked, but it does. Thanks again for all your help.

    Bob

    Want to join the discussion? Create an account or log in if you already have one. Joining is fast, free and painless! We’ll even whisk you back here when you’ve finished.