mod7 Journal

Search

mod7 Journal

pin it Using a background instead of a list-style-image…

Using a background instead of a list-style-image…

This forum had a post regarding a good cross-browser list style hack that gives one more precise control over custom bullet point graphics. The gist is here:

1. HTML:

2. CSS: (comments added for post)

#newsList ul { /* for positioning and styling preferences */
padding:0;
margin:0;
}

#newsList li a, #newsList li a:visited {
list-style-type:none; /* removes default bullet */
background-image:url(../img/arrow_red.gif);
background-repeat: no-repeat; /* ONE bullet only please */
background-position: 0 .45em; /* .45em from top (vertical) */
padding-left:12px; /* space between bullet and text */
/* styling options below */
line-height:1.5em;
font-weight:bold;
color:#000;
text-decoration:none;
}

Pretty painless and degrades nicely to boot. Noo doot aboot it.

Leave a Reply