tags:

views:

143

answers:

3

I would like to have a robust CSS that would have all forms I have looking the same.

I encounter a problem when defining CSS properties for the buttons and textboxes

here is the css

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

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

"#content .forms 'input' "

makes then look the same. Any ideas on how i would go about this?

+6  A: 

If you can ignore IE6 you could use the attribute selector:

input[type="text"] {

}

input[type="button"] {

}

If you can't, you will have to give your buttons/textboxes a class and apply styles to that class.

Jan Hančič
can i add a class to a class because already .forms is a class
Gatura
show us the markup you have. You can use multiple classes on one element: <input class="SomeClass SomeOtherClass" ... />
Jan Hančič
Sure an element can have multile classes
IronGoofy
+1  A: 

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

klausbyskov
+2  A: 

You can add multiple classes to an element by separating the classes with a space.

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

rahul
+1 for understanding the question ..
infant programmer