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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T13:55:17+00:00 2026-05-27T13:55:17+00:00

Is there a CSS selector to select this element by its inline style attribute

  • 0

Is there a CSS selector to select this element by its inline style attribute value?

<div style='display:block'>...</div>

something like

div[cssAttribute=cssValue]
  • 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-27T13:55:17+00:00Added an answer on May 27, 2026 at 1:55 pm

    The inline style attribute is no different to any other HTML attribute and can be matched with a substring attribute selector:

    div[style*="display:block"]
    

    It is for this very reason however that it’s extremely fragile. As attribute selectors don’t support regular expressions, you can only perform exact substring matches of the attribute value. For instance, if you have a space somewhere in the attribute value, like this:

    <div style='display: block'>...</div>
    

    It won’t match until you change your selector to accommodate the space. And then it will stop matching values that don’t contain the space, unless you include all the permutations, ad nauseam. But if you’re working with a document in which the inline style declarations themselves are unlikely to change at all, you should be fine.

    Note also that this is not at all selecting elements by their actual specified, computed or used values as reflected in the DOM. That is not possible with CSS selectors.

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

Sidebar

Related Questions

Possible Duplicate: Is there a CSS parent selector? Consider this markup: <div> <div> <p
Say there is a css style declaration to an element which has been set
Possible Duplicate: Is there a CSS parent selector? I know this is a shot
I need a CSS selector that selects a <select> element if it contains an
Does the star selector in CSS affect page rendering performance? Are there any caveats
Is there CSS Meta Framefork for ASP.NET? Something like LESS or xCSS.
Is there a CSS style that IE7 and Firefox will obey that changes the
Is there a CSS code that changes this text This is it to this
Are there any good CSS coding style/standards?
Is there a way in CSS to set the width of any element to

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.