![]() |
CSS Image resize question
I am resizing an image using CSS so that always fits within the browser window displaying the image.
The CSS I am using is Code:
div#sized { text-align: center; } Code:
<div id="sized"><a href="http://example.com"<img src="someimage.jpg" alt="image text" /></a></div> Does anyone have any idea on a better way to do this within the constraints of plain CSS and HTML ? |
You can use max-width to prevent the image from bleeding over the edge of the display area.
Code:
#sized img { max-width: 100%; } |
Quote:
http://viewportindustries.com/blog/a...-in-wordpress/ |
photo / image auto resizing is simple...
.photo img { width: 100% } .photo { width: 40% } // print can be any size you want the default to be and can be applied to a div as a class. |
Thanks for all the replies. I've got it sorted now.
|
All times are GMT -7. The time now is 12:27 PM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc