Quote:
|
I can't change what is in CSS file as it will impact the whole website.
|
This means you'll have to fight the CSS rules you set in your CSS file somehow.
Consider this:
img
{
vertical-align:middle;
}
Because of the generic selector (img) this applies to ALL images in your site, unless specified otherwise. There are a few ways around this, for example:
1. In-line styles take precedence over the element selector. So this should work (or at least override the previous declaration):
<img src="Tralala.jpg" style="vertical-align: top;" />
2. Be more specific. E.g. create a selector that's more specific than the img selector. For example, if your image is in a <div> with an ID of MainContent you can target the image like this:
#MainContent img
{
vertical-align:top;
}
Finally, you can use !important to overrule previous settings:
img
{
vertical-align:top !important;
}
However, when you add this in the same CSS file as the img selector, you might as well change the original definition.
Hope this helps...
Imar
BTW: you may need to turn your head 90 degrees to make all of this work. There's typically no "right" in a vertical direction.... ;-)