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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T00:05:19+00:00 2026-05-28T00:05:19+00:00

CSS : form input:not([type=’button’]),form input:not([type=’submit’]) { width: 200px } HTML : <form> <input type=’button’

  • 0

CSS:

form input:not([type='button']),form input:not([type='submit']) { width: 200px }

HTML:

<form>
  <input type='button' value='button' />
  <input type='submit' value='submit' />
  <input type='text' value='text' />
</form>

Demo: http://jsbin.com/imibew/edit#javascript,html,live

Issue: all input elements are getting width of 200px, where I just want the input of type text to have 200px.

Quirk: if you just list one selector in the , and not have a comma separated list, it works correctly.

Question: can I use commas when using :not()’s in CSS? Using lists in the selector seems to break it.

  • 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-28T00:05:20+00:00Added an answer on May 28, 2026 at 12:05 am

    The comma represents a logical OR in selector syntax. Each element will thus be matched against each part of your selector at a time, and if it satisfies at least one of those parts, the rule is applied.

    So in your case, this is what happens:

    1. The input[type='button'] will match your form input:not([type='submit']) selector

    2. The input[type='submit'] will match your form input:not([type='button']) selector

    3. The input[type='text'] will (obviously) match both selectors

    That’s why your rule gets applied to all your form inputs.

    If you want to combine both negations, chain them like so, instead of using a comma-separated list:

    form input:not([type='button']):not([type='submit']) { width: 200px }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

<style type=text/css> body { font-family:Helvetica, sans-serif; font-size:12px; } p, h1, form, button { border:
I have a form with a css submit button. When a the submit button
This is probably a basic html/css question... I have a simple one-button form that
form_page.html <html xmlns=http://www.w3.org/1999/xhtml> <head> <meta http-equiv=Content-Type content=text/html; charset=utf-8 /> <script src=js/process_truck_req.js></script> <script src=js/jquery-1.2.3.pack.js></script> <script
I have been looking at a couple html/css form frameworks like Uni-Form and Formy
I have attempted to use this CSS to set the width of my form
How can I hide an HTML form legend from visual browsers, using CSS, in
CSS table tr {border-bottom:1px solid #008999} HTML <table width=100% cellspacing=0 cellpadding=0> <thead> <tr> <th
I've got CSS that formats labels above form input elements and I'd like to
The code below is colouring the input but not submitting the form in chrome.

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.