Results 1 to 6 of 6

Thread: horizontal list image?

  1. #1
    Join Date
    Jan 2007
    Posts
    51
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default horizontal list image?

    Hi, all. I'm just learning CSS and doing ok with it but am very stumped on this.

    I can't seem to get my list to show a 'list-style-image' when I have the list in a horizontal configuration. I can place a background image, but that introduces it's own formatting issues. I know the link to the image is correct.

    Thoughts? Thanks for your time. -BN

    Code:
    ----------------------------------------------------
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">

    <html>
    <head>
    <title>Untitled</title>
    <style type="text/css">
    #folderowners{
    font-size: xx-small;
    font-weight: bold;
    text-align: left;
    background: #b4b4b4;
    border: 1px solid #000000;
    clear: both;
    margin: 0 0 5px 0;
    padding: 1px 0 5px 2px;
    }

    #folderowners ul li {
    display: inline;
    }

    #folderowners ul li a{
    padding: .2em 1em;
    }

    #folderowners ul{
    clear: both;
    text-align: left;
    margin: 0;
    padding: 0;
    }

    #folderowners li{
    list-style: none;
    list-style-image: url(../../images/mail_write_16.gif);
    }
    </style>
    </head>

    <body>

    <div id="folderowners">
    Folder Owner(s):
    <ul>

    <li><a href="mailto:xxx@xxx.xxx">O'Brian, Mary</a></li>

    <li><a href="mailto:xxx@xxx.xxx">Welch, Bob</a></li>

    <li><a href="mailto:xxx@xxx.xxx">Nicholas, Brent</a></li>

    </ul>
    </div>

    </body>
    </html>
    ----------------------------------------------------

  2. #2
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    This can be done in Opera and FF but not in IE (at least not that I could figure out). The styling of lists is one of the less consistent forms of style across browsers. Opera and FF will display it if done a certain way but, will differ between each other as far as spacing goes. If you have a method for doing it without the list-style-image, I'd go for it. I'd even consider dumping the list altogether.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  3. #3
    Join Date
    Jan 2007
    Posts
    51
    Thanks
    2
    Thanked 3 Times in 3 Posts

    Default

    OK, thatnk's for the info. I think I might try for a <DL> and see how that works out. I was using the list element since I'm aiming to be as symanticly correct as possible.. but since those browser agents can't play nice... )

  4. #4
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    You could try
    Code:
    list-style-position: inside;
    Nothing definite on this, but it sounds as if it ought to work.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

  5. #5
    Join Date
    Mar 2005
    Location
    SE PA USA
    Posts
    30,495
    Thanks
    82
    Thanked 3,449 Times in 3,410 Posts
    Blog Entries
    12

    Default

    Quote Originally Posted by Twey View Post
    You could try
    Code:
    list-style-position: inside;
    Nothing definite on this, but it sounds as if it ought to work.
    It does make things more consistent in FF and Opera, at least with a strict DOCTYPE but, the image still doesn't show in IE 7.

    What I didn't mention is that in order to have a list-style, an element must have display:list-item;, This is the default for li's but, changing it to inline breaks this of course. An inline sort of look can be got by floating the li's but, this introduces the need to clear the float, not a real problem. However, in the end, IE still will not show the image unless the list is vertical.
    - John
    ________________________

    Show Additional Thanks: International Rescue Committee - Donate or: The Ocean Conservancy - Donate or: PayPal - Donate

  6. #6
    Join Date
    Jun 2005
    Location
    英国
    Posts
    11,876
    Thanks
    1
    Thanked 180 Times in 172 Posts
    Blog Entries
    2

    Default

    Aah, yes, of course. I forgot about display: list-item;. Floating the list will be equally problematic in this case, since the specification states that any floated item should be treated as block-level. IE is probably doing the right thing here.
    Twey | I understand English | 日本語が分かります | mi jimpe fi le jbobau | mi esperanton komprenas | je comprends français | entiendo español | tôi ít hiểu tiếng Việt | ich verstehe ein bisschen Deutsch | beware XHTML | common coding mistakes | tutorials | various stuff | argh PHP!

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •