Feeling a bit embarrassed asking such a basic question, but I seem to be struggling with it.
I want to use CSS to style all IMG elements on my page that do not have any other class applied to them.
For instance, I want all images to have a red border by default, unless a different class is specified. It sounds simple enough, right? However, I'm running into issues where my other classes are being overridden by the base IMG class.
In this example, I aim to have a red border on the first image and a green border on the rest:
CSS:
<style>
IMG {
/* This should apply to all images except those with another style */
border: solid 12px red;
width:50%;
}
IMG.nicepic {
border: solid 12px green;
}
</style>
EDIT: The problem was just a typo in my code. IMG:nicepic
should have been written as IMG.nicepic
(using "." instead of ":"). This entire question was based on a simple mistake in my CSS file. I tried to delete the question, but stackoverflow denied me permission to do so.