I have created a CSS class called \'button\' and applied it to all of my INPUT tags by simply using :
.button input
{
//css stuff here
}
try this:
.button input, .button a {
//css here
}
That will apply the style to all a tags nested inside of <p class="button"></p>
You need to qualify the a
part of the selector too:
.button input, .button a {
//css stuff here
}
Basically, when you use the comma to create a group of selectors, each individual selector is completely independent. There is no relationship between them.
Your original selector therefore matched "all elements of type 'input' that are descendants of an element with the class name 'button', and all elements of type 'a'".
.button input,
.button a {
...
}
Try using:
.button input, .button a {
// css stuff
}
Also, read up on CSS.
Edit: If it were me, I'd add the button class to the element, not to the parent tag. Like so:
HTML:
<a href="#" class='button'>BUTTON TEXT</a>
<input type="submit" class='button' value='buttontext' />
CSS:
.button {
// css stuff
}
For specific css stuff use:
input.button {
// css stuff
}
a.button {
// css stuff
}