/    Sign up×
Community /Pin to ProfileBookmark

unordered lists bullets seem too high

Hi all. Can anyone suggest the best way to control the vertical position of a list item’s bullet point?
Kind Regards
Graham

to post a comment
CSS

7 Comments(s)

Copy linkTweet thisAlerts:
@KDLANov 22.2006 — Usually, I use vertical padding to help with that. Line height, applied to the <li> text, seems to help, too.

KDLA
Copy linkTweet thisAlerts:
@FangNov 22.2006 — A backgroud image on the li instead of a bullet is much simpler to adjust.
Copy linkTweet thisAlerts:
@DoppleauthorNov 22.2006 — KDLA, I have tried all of those but to no avail. I can move the bullet further away from the text (or vise-versa) but not closer to it by using a negative value which is odd. I will try the image idea. and get back to you.
Copy linkTweet thisAlerts:
@KDLANov 22.2006 — Yeah -- now that I think of it, IE has some real issues with list-style-image.

You might change the list-style to none, and use the background and some padding, as Fang suggested.
Copy linkTweet thisAlerts:
@DoppleauthorNov 22.2006 — Hmm. How would that work? I don't think I've ever heard of someone using the background as a bullet point.

Sound's pretty cool though. Are there any tutorials or online referneces to it?

Appreciated.

Graham
Copy linkTweet thisAlerts:
@KDLANov 22.2006 — List Style Image --

Here's how I used the technique on pages like [url="http://www.e-archives.ky.gov/Pubs/AG/Attorney_Gen.htm"]this[/url].
#e-archive-content ul {font-family: verdana, sans-serif; font-size: .85em; font-weight: bold; }
#e-archive-content li.htm {font-family: verdana, sans-serif; list-style-image: url(http://kdla.ky.gov/images/misc/globe.gif); }
#e-archive-content li {list-style-image: url(http://kdla.ky.gov/images/misc/sheet.gif); margin-top: .75em; padding-left: 5px;}
#e-archive-content li ul {font-size: .9em; font-weight: normal; list-style-type: disc;}
#e-archive-content li ul li ul {font-size: 1em; list-style-type: square;}


As to background image, it's pretty easy. You place the list-style-type to none, apply the background to the li, and put enough padding on the left for the text to clear the image.

Using a 20x20 px image:
<i>
</i>ul {margin: 0; padding: 0;}
ul li {list-style-type: none; background: #fff url(file.gif) no-repeat top left; padding-left: 25px; line-height:20px; height: 20px; margin: auto 3em; display: block;}


When you're working with inline lists, the background technique is easier to work with, since inline lists do not normally have bullets. The background technique is good, too, because you could apply it to the <a> nested in a <li> (with no margin/padding set), allowing you to create a rollover effect on hover.

KDLA
Copy linkTweet thisAlerts:
@DoppleauthorNov 23.2006 — Ok I think I see now. I'll give it a go.

Thanks!
×

Success!

Help @Dopple spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.20,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...