Im having problems with bullets I have assigned to my lists
I want one li to have a twitter icon as it is a link to a twitter page and the other li to have a facebook icon…
i set both li’s like the following:
<ul>
<li class=“twittericon”><a href=“#”>FOLLOW US ON TWITTER</a></li>
<li class=“facebookicon”><a href=“#”>VISIT OUR FACEBOOK PAGE</a></li>
</ul>
you can visit the page in question and will notice the lists appear in the header and footer
I think it is the the display:inline; on the li that removes the bullet images. Try using floats instead. I think it will let you keep your bullet images that way.
Edit: I guess it’s not quite a simple as that. There seems to be more repeated code affecting how this displays and I had to get rid of a lot of inherited styles (using Firebug) to get it to work using list-style-image. However, Rayzur has a pretty good suggestion there using background images instead. It would be much simpler than trying to overwrite all these inherited styles.
Do you need the icons that large? They would line up automatically if they were the same height as the text…
hmm, when I need bullets to line up in a certain way I usually default to background images like in Rayzur’s example because positioning bullets - other than the inside/outside value - simply doesn’t work. ^^;; If I knew of a way I would most certainly tell you.
I tried adding vertical-align to the nested <a> tags and it seems to work in FF/Firebug. Never thought to try this before but it might be the answer. (I’m going to do some more testing with this on my own later…)
Try this out:
#header li a, #footer li a {
color:#FFFFFF;
font-size:10px;
font-weight:bold;
padding:0 0 50px;
text-decoration:none;
vertical-align:130%; /* this might be the fix? */
}
Hi,
Yes the BG image exceeded the height of the line-box when you were using display:inline on your list items. You will always get more control over your UL when you use block level list items/anchors.
Working with the images that you have provided you could set the anchors at the same height and center your text vertically with line-height. You can always position your BG images also. I set them at no-repeat 0 50% in the code below but you will not see the BG image center vertically unless the anchor is taller than the image.
It is always good to group your relevant styles together so you are not having to hunt them down to make changes. Your twitter & facebook li classes were at the bottom of your stylesheet and the UL styles were up top. Set your css up in the same manner as your html and code maintenance will be much easier for you.