Hash
Hash

Reputation: 8020

Input type submit button in form css issue

I have input type button (in a form) in a div, i tried changing the css of the input but it has no effect.

<input type=button value="Search" id="search">

css:

input[type=submit] {
color: #000000;
         background-color: #FFFFFF;
         font-size: 16px;
}

Upvotes: 0

Views: 181

Answers (6)

Shems Eddine
Shems Eddine

Reputation: 141

in your css do:

input[type='button'] {
color: #000000;
         background-color: #FFFFFF;
         font-size: 16px;
}

also try putting the button for the type param in quotes:

<input type='button' value="Search" id="search">

Upvotes: 0

Bryan Labuschagne
Bryan Labuschagne

Reputation: 213

Use semicolons in your css:

input[type="submit"] {
color: #000000;
     background-color: #FFFFFF;
     font-size: 16px;
}

Or

input[type="button"] {
color: #000000;
     background-color: #FFFFFF;
     font-size: 16px;
}

Upvotes: 0

SkyBlues87
SkyBlues87

Reputation: 1235

You've set the id so just refence that:

#search {
  color: #000000;
  background-color: #FFFFFF;
  font-size: 16px;
}

Upvotes: 0

roNn23
roNn23

Reputation: 1662

Your input type is button (without quotation marks). It should be submit. Also you CSS-selector should be with quotation marks.

input[type="submit"] { ... }
<input type="submit" value="Search" id="search">

Upvotes: 0

Akshay
Akshay

Reputation: 14348

You have given button instead of submit Fiddle

input[type=submit] {
    color: green;
    background-color: #FFFFFF;
    font-size: 16px;
}
<input type="submit" value="Search" id="search">

Upvotes: 0

Mathew Thompson
Mathew Thompson

Reputation: 56429

Your markup specifies [type=button], yet your CSS references [type=submit].

Change your HTML:

<input type="submit" value="Search" id="search">

Upvotes: 2

Related Questions