Separate text fields and buttons in css

I would like to have robust CSS that has all the forms that I looked the same.

I am facing a problem when defining CSS properties for buttons and text fields

here is css

#content .forms input {
    border: 1px solid #CCCCCC;
    background-color: #FFFFFF;
}

I would like to have CSS for buttons separate from buttons, but

"# content.forms 'input'"

does the same thing. Any ideas on how I will do this?

+3
source share
3 answers

You can add multiple classes to an element by dividing the classes into spaces.

<style>
    .FirstClass { color: #a9a9a9 }
    .SecondClass { font-size: 10pt; }
</style>
<input type='text' class='FirstClass SecondClass' />

Adding multiple classes can be confusing if you apply more and more classes to a single element.

+2
source

IE6, :

input[type="text"] {

}

input[type="button"] {

}

, / .

+6

you can use attribute selectors for example input[type="submit"].

+1
source

Source: https://habr.com/ru/post/1726702/


All Articles