0

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;
}
1
  • The type you have is submit in the css, but the type it is is button in the html. Try changing the css to type=button Commented Jan 16, 2015 at 14:05

6 Answers 6

2

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

Change your HTML:

<input type="submit" value="Search" id="search">
Sign up to request clarification or add additional context in comments.

Comments

0

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">

Comments

0

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">

Comments

0

You've set the id so just refence that:

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

Comments

0

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;
}

Comments

0

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">

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.