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 7641825
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T09:01:27+00:00 2026-05-31T09:01:27+00:00

I know for standard html attributes there are CSS selectors: span[class=example] But I would

  • 0

I know for standard html attributes there are CSS selectors:
span[class="example"]

But I would like to know if there are selectors for CSS attributes, e.g.
span[background-image].
?

Update:
After reading some of the comments and answers so far, I better give a reason for this “strange” need. I would like to find all elements that have background-image set to anything other than undefined/empty, to apply style to them. The assumption is that I cannot control the existing inline/global styles, only add my own global style sheet.

  • 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-31T09:01:28+00:00Added an answer on May 31, 2026 at 9:01 am

    No.

    It would be too expensive a rule for the browser to look up. As you are most likely setting the background-image in other css classes, it would be fairly straightforward to target them explicitly (also, not by using span[class=”example”] but span.example instead)

    Also, as you noted in the comments to another answer, rules of the type

    span[style*="background-image"]​{}​
    

    would only apply to inline styles, and you’re in for a nightmare if you’re looking them up by value like so

    span[style*="background-image: url(potato.png)"]​{}​
    

    Is the background set explicitly or through a shorthand property like background:#fff url(potato.png); Did I enter a space there or not? Capitalization, maybe it’s .PNG?

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

Sidebar

Related Questions

I would like to know how and if I can add standard HTML elements
Here is the standard inclusion tag: @register.inclusion_tag('results.html') def show_results(poll): ... I'd like to know
I'd like to know the standard way to benchmark a SQL Sever Query, preferably
I know there is a standard behind all C compiler implementations, so there should
I know Firebug is the standard, but I find myself using Chrome a lot
I know there are non-standard frameworks such as commons-validator, and hibernate validator. I wanted
I know what's the standard way to document functions, classes and modules, but how
I have a standard HTML login page, which I would much rather use than
I know there's more important questions to discuss probably, but at the cost of
I know that Hpricot is still a standard but I remember hearing about a

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.