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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:26:43+00:00 2026-06-05T05:26:43+00:00

I have two sets of input type=text elements that are styled differently in CSS.

  • 0

I have two sets of input type=text elements that are styled differently in CSS. For the first set, the length is determined by CSS width. For the second set, the size value is used to determine the length of the input box:

<input type=text name=name value='Jason Bourne'> /*1st set*/
<input type=text name=cardNumber value='4111111111111111' size=19> /*2nd set*/

Without introducing a class or id attribute, is it possible to style the two sets separately using just CSS selectors?

Clarification: size 19 above is just an example. I want to be able to select based on whether the size attribute is set or not, combine with the attribute that type is text.

  • 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-06-05T05:26:44+00:00Added an answer on June 5, 2026 at 5:26 am

    It is possible – http://jsfiddle.net/geQqG/2/

        input[type="text"]{
        color: red;
    }
    
    input[size]{
        color: green;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have two sets of objects where in some cases the first set will
I have two sets of elements with (sometimes) corresponding rel and id attributes: <a
I have two Sets. Set b is the subset of Set a . they're
I have two sets of vectors, set A and set B. Let's say set
I have two separate sets of tables in the same database that model the
I have a class that contains two sets. They both contain the same key
I have a program that compares variables from two structs and sets a bit
I have two sets of of input fields like this, differentiated by their classes:
For simplicity, let's say that I have two sets of words, sorted into alphabetical
I have a regular text-box: <input type=text> I use jQuery to handle key-related events:

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.