CSS help with list - Post ID 131325

User 47216 Photo


Registered User
210 posts

OK so here is my dilemma as I am in the process of a complete redesign of my web site. Where I am inserting a list utilizing the <ul> and <li> tags is my problem.

The settings for this is alls et up in my css file with a custom bullet for each line and here is the coding I am using...

#rightcolumn_1 li {
background: url('images/main_bullet.jpg') no-repeat 0px 8px;
padding: 5px;

}


The problem is that the text overlaps the bullet image so I have to put in about 4 nbsp space codes. Here is a test page where you can see what I am talking about... http://www.disneytrivia.net/test1.php . Ideally I would like to have it set up so that the text with multiple lines is completely aligned on the left side with the bullet.

Any help would be appreciated
User 562592 Photo


Registered User
2,038 posts

There are a couple of ways you can do this. You could set a height for the background image and then use your padding to move the bullet image where you want it. However, the best way I find is to set your "background-position" property using top right bottom and left. See if that works for you.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 463058 Photo


Ambassador
1,086 posts
Online Now

Try "padding: 5px 5px 5px 20px;"

This increases the space on the left side for the background image.
User 562592 Photo


Registered User
2,038 posts

Cary wrote:
Try "padding: 5px 5px 5px 20px;"

This increases the space on the left side for the background image.


Cary, could you specify what you would like him to apply the padding to.
The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 463058 Photo


Ambassador
1,086 posts
Online Now

Where it appears in Ron's post.
User 47216 Photo


Registered User
210 posts

Thanks Cary - worked perfectly as you can see here... http://disneytrivia.net/park_pages/wdw_studios_facts.php

I did try adjusting that padding a bit but I didnt add the extra variables in there

:D
User 463058 Photo


Ambassador
1,086 posts
Online Now

EDIT: Ignore this suggestion if everything looks right.

Captain Ron wrote:
Ideally I would like to have it set up so that the text with multiple lines is completely aligned on the left side with the bullet.


Oh, I think I misread that before. For that try this styling:

#rightcolumn_1 li {
list-style-image: url('images/main_bullet.jpg');
list-style-position: inside;
padding: 5px;
}
User 47216 Photo


Registered User
210 posts

Also really not on the subject of CSS but I noticed that anywhere I have text appearing with an asterisk Mozzilla Firefox does not display the character but instead shows a small question mark. Anyway around this?
User 562592 Photo


Registered User
2,038 posts

You have to put this code in the html in place of the star:

&#8727

The philosopher has not done philosophy until he has acted upon the mere conviction of his idea; for proof of the theory is in the act, not the idea.

My Web Development Company: http://www.innovatewebdevelopment.com (Created with Coffee Cup Software).

My Personal Website: http://www.EricSEnglish.com

User 47216 Photo


Registered User
210 posts

Cary wrote:
EDIT: Ignore this suggestion if everything looks right.

Captain Ron wrote:
Ideally I would like to have it set up so that the text with multiple lines is completely aligned on the left side with the bullet.


Oh, I think I misread that before. For that try this styling:

#rightcolumn_1 li {
list-style-image: url('images/main_bullet.jpg');
list-style-position: inside;
padding: 5px;
}


No you hit the nail on the head with the first adjustment to the code.... thank again

Have something to add? We’d love to hear it!
You must have an account to participate. Please Sign In Here, then join the conversation.