×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

prevent li having an image

prevent li having an image

prevent li having an image

(OP)
Hi all,

My content li has an image.
#content li {
list-style-type: none;
background: url(img/bullet.gif) no-repeat 0px 8px;
etc ...
}

How do I make an li below this id not have this image. I could make a new id/class but what is the syntax to cancel the image?

Thanks.

Age is a consequence of experience

RE: prevent li having an image

CODE

.class {
	background-image: none;
} 

Darryn Cooke
www.darryncooke.com | Marketing and Creative Services

RE: prevent li having an image

(OP)
Thank you!

Age is a consequence of experience

RE: prevent li having an image

(OP)
Sorry but that didn't seem to work?

tried background-image: none; and background: none;

.content_no_li_image li {
background: none;
}

http://oakhowelettings.com/tenants.html

Age is a consequence of experience

RE: prevent li having an image

you only need to create the class

CODE

.noimage {
	background-image: none;
} 

then you apply it as such

CODE

<ul>
<li></li>
<li class="noimage"></li>
<li></li>
<li></li>
</ul> 

your syntax

CODE

.content_no_li_image li {
background: none;
} 

is looking for all "li" elements within a container with a class name "content_no_li_image" so not sure that will do what you are trying to do.

Darryn Cooke
www.darryncooke.com | Marketing and Creative Services

RE: prevent li having an image

(OP)
I do not want any of the li tags to have an image from this ul. but above this there is another ul that i want the li to have the bullet image?

Thanks for your time.

Age is a consequence of experience

RE: prevent li having an image

(OP)
background: none;
This did di it? IE must have cached the page.

Thanks

Age is a consequence of experience

RE: prevent li having an image

Quote:


I do not want any of the li tags to have an image from this ul. but above this there is another ul that i want the li to have the bullet image?
I suggest you apply a class to the ul, and write CSS code to control how it appears. Something like this:

CODE

My content li has an image.
ul.bullet li {
list-style-type: none;
background: url(img/bullet.gif) no-repeat 0px 8px;
etc ...
}

ul.nobullet li {
list-style-type: none;
background: none;
} 
Then yor html would look like this:

CODE

<ul>
<li>Normal HTML bullets</li>
<li>Appear on this list</li>
</ul>
<ul class="bullet">
<li>Your custom image bullets</li>
<li>Appear on this list</li>
</ul>
<ul class="nobullet">
<li>No bullets at all</li>
<li>Appear on this list</li>
</ul> 
If all your lists should have the custom bullet, apply the appropriate CSS to the plain ul li, and just have the class to identify the unbulletted list(s).

Having said all that - "bullet" and "nobullet" are bad names for CSS classes. It's better to name them for what the relevant lists represent than for how they are displayed. e.g. class="subjects", class="menu", class="tags" or whatever. That way, if you change your mind about how that list is displayed vis-a-vis bullets, your class name will remain sensible.

-- Chris Hunt
Webmaster & Tragedian
Extra Connections Ltd

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login


Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close