Forum Moderators: not2easy
I'd like to change style using css. Is there possibility to crate new style and automatic change images style without setting class="" in img tag on all images?
Welcome to WebmasterWorld! Since you have hard-coded attributes into your tags, these would automatically override all external CSS rules. Remember the order of CSS: external, internal, inline. Each one progressively overrides the higher one.
If you have 2000 images, it seems that you're in for a lot of work! But once you have a class established, changing it will be much easier.
I'd like to change style using css. Is there possibility to crate new style and automatic change images style without setting class="" in img tag on all images?
Yes.
img { border: 1px solid #000000; padding: 4px; }
Creates and outset black border. Beware, this does affect all your images, but you can override them with class or ID selectors.
Be sure to use that alt tag. Don't leave it blank, it has a purpose. :-)
Since you have hard-coded attributes into your tags, these would automatically override all external CSS rules.
Not entirely true . . . try . . .
<img src="some-image.jpg" width="494" height="480">
img {
border: 1px solid #000000;
padding: 4px;
width: 300px;
height: 200px;
}
I'm getting an image distorted to 300 X 200 pixels.