I am wanting to create a default style that will be used for all <input> tags on my page. Is there as way that I can set a default style for <input type="text"> and then a different one for <input type="password"> or <input type="button"> ? I tried this:
input {
background-color: red;
}
but that changes the background color for all <input> elements. I then tried:
input:text (and input.text) {
background-color: red;
}
but that didn't do anything at all. Can anyone help me out? Thanks in advance.
Question about default styles for <input> tags.
Try using classes instead of "type," ie specify classes in the css like input.text, imput.password, etc., then refrence them the html like <input class = "text">, etc. Hope that helps. - Jen
Question about default styles for <input> tags.
Hmmm yes that seems to work, I guess I will just have to specify a class for all of the <input> tags. I was hoping to not have to do that.
Question about default styles for <input> tags.
YOu can just use
input {
background-color: red;
}
then make a class called
.password {
background-color: blue;
}
and in the html use <input class="password" etc etc>
Question about default styles for <input> tags.
Yeah, I know how to get around it by using specific classes, but I have the rest of my page set with default styles (like one for all default <td> tags, etc.) and I wanted to do the same for <input> tags... I guess it can't be done.
Question about default styles for <input> tags.
Yes it can - use
input {
blah
}
for all input boxes, but use a class for ones you want to style differently.