Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5842663
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T12:02:49+00:00 2026-05-22T12:02:49+00:00

I have a template which sets global img tag properties as such: #content img

  • 0

I have a template which sets global img tag properties as such:

#content img {
    background: none repeat scroll 0 0 #FFFFFF;
    border: 1px solid #CFCFCF;
    margin-bottom: 2px;
    padding: 2px;
}

I have a list on my page and one of the items needs to have a small transparent image. The styling above is causing the image to get a background and borders that I do not want. The list html is:

<div id="land_items">
<ul>
<li class="trace_item">
<a href="/imglink"><img src="img/popup.png"></a>
</li>
</ul>
</div>

I have tried to override the img tag with the code below, but Firebug continues to show these rules with a “strikethrough” indicating the global img styling above is taking precedence. I hear this could be because id css styles override class styles. How do I accomplish this?

li.trace_item img {
    background-color: transparent;
    border: none;
    padding: 0;
    margin: 0;
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T12:02:49+00:00Added an answer on May 22, 2026 at 12:02 pm

    That’s because CSS uses specificity when applying the styles (it cascades)

    It should work for you if you change it to

    #content li.trace_item img {
        background-color: transparent;
        border: none;
        padding: 0;
        margin: 0;
    }
    

    Here’s specificity explained in Star Wars terms : http://www.stuffandnonsense.co.uk/archives/css_specificity_wars.html

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

First three elements of the background: I have created a Excel Template which is
I have a template tag which returns datetime objects converted to the user's timezone.
I have a complex WPF UserControl made of other ContentControl templates which contain sets
I have a Freemarker template which contains a bunch of placeholders for which values
I have a large text template which needs tokenized sections replaced by other text.
I have a Template Column under which I have Placed a Dropdownlist. Now I
I have a file template.txt which contains the following: Hello ${something} I would like
I have an e-mail template which is just a plain, static HTML page. I
I have a ComboBox in WPF which is databound, and has data template which
something driver me crazy here i have a big HTML template which i can't

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.