Approach 1
A commonly used technique for achieving this involves the concept of specificity in CSS. Essentially, the more specific a selector is, the higher precedence it has. This can be illustrated with the following example:
<section>
<div class="container">
<img src="blahblah.jpg" />
<div class="wrap">
<img src="blahblahblah.jpg">
</div>
</div>
<section>
<img>
<img>
If you apply styles using just `img`, they will affect all images on the page. However, if you use a more specific selector like `section .container .wrap img`, those styles will take precedence for that particular image. In CSS, specificity reigns supreme.
Approach 2
In addition to the aforementioned approach proposed by user853284, which recommends utilizing IDs as selectors:
/* img#ID - ID can be anything you choose */
img#hover {
opacity:1;
filter:alpha(opacity=100);
}
This can then be implemented as shown below:
<img id="hover" src="blahblah.jpg" />
Chris Coyier has shared a demo highlighting this. By removing one of the classes from the container, you'll notice a color change, indicating that IDs override classes in terms of styling priority.
Approach 3
Use with Caution
The final method worth mentioning involves the use of `!important` in CSS declarations, which forcefully overrides any competing styles on the page. However, this practice is generally frowned upon due to its potential for causing conflicts and maintenance issues in the future.