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

  • Home
  • SEARCH
  • 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 128729
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 11, 20262026-05-11T05:40:55+00:00 2026-05-11T05:40:55+00:00

Is there any way with CSS to target all inputs based on their type?

  • 0

Is there any way with CSS to target all inputs based on their type? I have a disabled class I use on various disabled form elements, and I’m setting the background color for text boxes, but I don’t want my checkboxes to get that color.

I know I can do this with seperate classes but I’d rather use CSS if possible. I’m sure, I can set this in javascript but again looking for CSS.

I’m targeting IE7+. So i don’t think I can use CSS3.

Edit

With CSS3 I would be able to do something like?

INPUT[type='text']:disabled that would be even better get rid of my class altogether…

Edit

Ok thanks for the help! So here’s a selector which modifies all textboxes and areas which have been disabled without requiring setting any classes, when I started this question I never thought this was possible…

INPUT[disabled][type='text'], TEXTAREA[disabled] {        background-color: Silver; } 

This works in IE7

  • 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. 2026-05-11T05:40:55+00:00Added an answer on May 11, 2026 at 5:40 am

    Yes. IE7+ supports attribute selectors:

    input[type=radio] input[type^=ra] input[type*=d] input[type$=io] 

    Element input with attribute type which contains a value that is equal to, begins with, contains or ends with a certain value.

    Other safe (IE7+) selectors are:

    • Parent > child that has: p > span { font-weight: bold; }
    • Preceded by ~ element which is: span ~ span { color: blue; }

    Which for <p><span/><span/></p> would effectively give you:

    <p>     <span style='font-weight: bold;'>     <span style='font-weight: bold; color: blue;'> </p> 

    Further reading: Browser CSS compatibility on quirksmode.com

    I’m surprised that everyone else thinks it can’t be done. CSS attribute selectors have been here for some time already. I guess it’s time we clean up our .css files.

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

Sidebar

Ask A Question

Stats

  • Questions 89k
  • Answers 89k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer \footnotesep is the space between footnotes: \setlength{\footnotesep}{0.5cm} \footins is the… May 11, 2026 at 5:52 pm
  • Editorial Team
    Editorial Team added an answer The white space as you have it is insignificant and… May 11, 2026 at 5:52 pm
  • Editorial Team
    Editorial Team added an answer You could just run the generator and ignore the models/migrations/fixtures.… May 11, 2026 at 5:52 pm

Related Questions

I am using Python to read in data in a user-unfriendly format and transform
I use the following javascript (with jQuery) to handle drag and drop on a
I can't tell if this is a result of the jQuery I'm using, but
Ok, I've been tasked to port/convert/upgrade a site at work from table based layout

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.