View Single Post
Old 06-12-2012, 12:44 AM  
AdultKing
Raise Your Weapon
 
AdultKing's Avatar
 
Industry Role:
Join Date: Jun 2003
Location: Outback Australia
Posts: 15,605
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; }
div#sized img{	height: 90%; border: none; padding:15px; top: 10%; position: relative }
the HTML is

Code:
<div id="sized"><a href="http://example.com"<img src="someimage.jpg" alt="image text" /></a></div>
It works fine in Safari and Firefox, however will not work on the iPad or iPhone. On those devices it just shows the full sized image not constrained within the DIV.

Does anyone have any idea on a better way to do this within the constraints of plain CSS and HTML ?

Last edited by AdultKing; 06-12-2012 at 12:45 AM..
AdultKing is offline   Share thread on Digg Share thread on Twitter Share thread on Reddit Share thread on Facebook Reply With Quote