Weirdo CSS question

| work related stuff | | Comments (4)

Goal: Gold square bullets with black text.

You'll have to save this to your own computer to see it work. I tried to set it up in the Audrey skin but it's being bizarre.

Anyway, without the bold, the everything is black. Even the square.

Any ideas what we're doing wrong?

UL {
color : #CC9900;
list-style-type: square;
}

LI B {
font-family : Arial;
font : 11pt;
color : black;
font-weight: normal;
}

<ul>
<li>Item one</li>
<li><b>Item two</b></li>
</ul>

  • Item one
  • Item two

4 Comments

Jennifer said:

Well, I'm seeing all gold (Firefox 1.0.4 on XP SP2).

On my own machine, I see your code the way you intended. I just did a quick google and it seems that you are right - you need a tag of some sort surrounding the text of the bullet in order to change its color.

If you don't want to hack your bold tag, just surround it in a div with style="color:black;" - or, of course, give the div a class and specify color there.

You're on the right track. smile

jake said:

Yeah, you basically have two options, use an image for the bullet that's gold. Or wrap the text in something.

I'd avoid using something like a div, it's overkill. "b" and "i" don't have anything semantically associated with them like "strong" or "em." So you could either give the actual b a class to style just them.

li b.dark {
font-family : Arial;
font : 11pt;
color : #000;
font-weight: normal;
}

  • text
  • Or you could just give the list itself an id or class so that you're not styling every instance of "b" in a list.

    Hope that helps...

    adi said:

    You can:

    a) Use an image as shown in this Listamatic Tutorial (top one!)
    (Jake also mentions this, but this gives more clarity as to how-to)

    b) Set a class or id for the lists that will have gold bullets:

    .goldBullets {
    color : #CC9900;
    list-style-type: square;
    }

    .goldBullets li b {
    font-family : Arial;
    font : 11pt;
    color : black;
    font-weight: normal;
    }

    This is similar to what Jake wrote in the closing of his post, and I think it's better to use to restrict the styling to just the goldbullet lists, instead of all lists with bold text.

    Either way works, up to you!

    jake said:

    Good job Adi, I should have been a little more helpful and gave links, etc. to get the ball rolling.

    Leave a comment

    About this Entry

    This page contains a single entry by Lisa published on June 6, 2005 12:58 PM.

    A homebody was the previous entry in this blog.

    Jack on the beach is the next entry in this blog.

    Find recent content on the main index.

    Me!

    "I may disagree with what you have to say, but I shall defend, to the death, your right to say it."—Voltaire

    About me... :: memes :: My Amazon wishlist :: My LJ :: My Twitter :: My Flickr :: Photos of me

    Blog reading list

    Contacts
    · AIM, Yahoo!, MSN, Google Talk, LJ Talk... just ask
    · Email me

    Good Causes

           
    Love is love.
    Support gay marriage.

    platinum.gif
    East siiiiiiiiiiiiiiiiiiiide, baby!
    Click to help
sponsor mammograms
    Listen to good music! Radio Paradise

    Silly Stuff

    blogchalk:
Lisa/Female/41-45. Lives in United States/Mass/Boston and speaks
English. Spends 80% of daytime online. Uses a Faster (1M+) connection.
    The
WeatherPixie
    The weather in Boston

    Flickr

    www.flickr.com
    jasra's photos More of jasra's photos
    Powered by Movable Type 4.1

    Copyright

    Copyright © 2001-7 Lisa K Holsberg. Unauthorized use is prohibited.