![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
I've got an unordered list with a list-style-type of 'square.' The color of this (and the text in the list) is black. Is it possible, via the CSS, to specify the color of this square (i.e. make the bullet red) without changing the color of the text in the list also? |
#3
| |||
| |||
|
#4
| |||
| |||
|
|
spm wrote: I've got an unordered list with a list-style-type of 'square.' The color of this (and the text in the list) is black. Is it possible, via the CSS, to specify the color of this square (i.e. make the bullet red) without changing the color of the text in the list also? Under CSS 2.1, no.[*] The current WD of the CSS 3 Lists module does specify the ::marker pseudo-element which would do exactly what you want; FF has been tested to not support ::marker and I doubt that either Safari or Opera has it. IE, of course, does not support it. [*] Not directly, at least. Wrapping a <span class="foo"> within each li> element allows you to do this, but it is relatively hack-ish. |
#5
| |||
| |||
|
|
You could make the bullet an image and then use something like the following to invoke it ... ul { list-style-image : url( "http://www.xxxxxxxx.com/bullet.gif" ); } ... Thom __________________________________________________ _ Thom Little - www.tlanet.net - Thom Little Associates, Ltd. |
#6
| |||
| |||
|
|
Note, that browsers won't resize the image specified with list-style-image, when the user changes the font size. |
#7
| |||
| |||
|
|
Scripsit Johannes Koch: Note, that browsers won't resize the image specified with list-style-image, when the user changes the font size. Unfortunately, we have the same problem with the default list bullets, |
#8
| |||
| |||
|
|
Jukka K. Korpela schrieb: Scripsit Johannes Koch: Note, that browsers won't resize the image specified with list-style-image, when the user changes the font size. Unfortunately, we have the same problem with the default list bullets, Well, at least my Firefox 1.5.0.12, IE 7.0.5730.11, Opera 9.22 (all Win) resize the default list bullets when resizing the text. |
#9
| |||
| |||
|
|
The only way to make bullets get the same size as text is to make them part of the textual content somehow. Using :before pseudo-elements and generated content, this would be possible in pure CSS, but IE still doesn't support them. |
#10
| |||
| |||
|
|
Thanks for the explanation Joshua. I'll look forward to CSS 3 in that case, though I guess it'll be several years yet before the specification is even agreed, never mind supported by the major browsers of the day. Thanks. |
![]() |
| Thread Tools | |
| Display Modes | |
| |