...

View Full Version : Resizing <img src> in a div



BoyWander
04-05-2011, 04:39 AM
I have image link buttons in a div in the middle of a webpage, and I made them with a graphic generator.

They are each 160px wide. How can I resize their width to be a certain % of size of the div box they are in, so that it works on all resolutions?

Thank you.

BTW I have them in there as .....<a href:"....."><img src="....." alt="..."></a>.....

BoyWander
04-05-2011, 05:56 AM
BTW here is the code of that particular section.




<div id="GamesArea">
<style type="text/css">
#GamesArea {position:relative;float:left;
width:55.1%;margin:10px;height:380px;}
</style>



<table width="100%" height="33%" style="position:relative;margin:auto;margin-left:2%;">
<tr><td><a href="Euchre.html"><img src="http://weplaycards247.com\Images\Euchre.png" alt="Euchre"></a></td>
<td><a href="Canasta.html"><img src="http://weplaycards247.com\Images\Canasta.png" alt="Canasta"></a></td>
<td><a href="Bridge.html"><img src="http://weplaycards247.com\Images\Bridge.png" alt="Bridge"></a></td></tr>
</table>

<table width="100%" height="33%" style="position:relative;margin:auto;margin-left:2%;">
<tr><td><a href="Hearts.html"><img src="http://weplaycards247.com\Images\Hearts.png" alt="Hearts"></a></td>
<td><a href="Cribbage.html"><img src="http://weplaycards247.com\Images\Cribbage.png" alt="Cribbage"></a></td>
<td><a href="Pinochle.html"><img src="http://weplaycards247.com\Images\Pinochle.png" alt="Pinochle"></a></td></tr>
</table>


<table width="100%" height="33%" style="position:relative;margin:auto;margin-left:2%;">
<tr><td><a href="Rummy.html"><img src="http://weplaycards247.com\Images\Rummy.png" alt="Rummy"></a></td>
<td><a href="Spades.html"><img src="http://weplaycards247.com\Images\Spades.png" alt="Spades"></a></td>
<td><a href="Pitch.html"><img src="http://weplaycards247.com\Images\Pitch.png" alt="Pitch"></a></td></tr>
</table>

</div>

Aurora.Light
04-05-2011, 05:58 AM
if you created it with a graphic generator - recreate it w/ the desired dimensions

idk exactly what's your question, but try

#middle img {
width: 120%
}

I'm not sure but I g2g. sorry for the sloppy/probably incorrect answer

BoyWander
04-05-2011, 06:10 AM
Well I dont think the image generator will allow me to set the width as a %, only fixed pixel - but thanks Aurora for the help!


Anyways I think I got it taken care of. Now it's on to getting a user login system to work, I've been working on it for 4 days and haven't gotten very far.

php is a little more difficult than html/css...



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum