Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > General Computer Discussion > General Computer Support > Centering and scaling divs to fit any browser

Reply
Thread Tools

Centering and scaling divs to fit any browser

 
 
tcarone07 tcarone07 is offline
Junior Member
Join Date: Feb 2009
Posts: 1
 
      02-06-2009
I don't know much about web design so maybe I'm going about this the wrong way but...

I'm created a div with several icon images and then a few other divs that contain images that would be linked to other pages I need a code to center and scale the div images to fit the browser. thanks!

#apDiv1 {
position:absolute;
left:217px;
top:199px;
width:517px;
height:265px;
z-index:1;
}
#apDiv2 {
position:absolute;
left:10px;
top:0px;
width:200px;
height:200px;
z-index:5;
}
#apDiv3 {
position:absolute;
left:294px;
top:118px;
width:1px;
height:1px;
z-index:6;
}
#apDiv4 {
position:absolute;
left:250px;
top:50px;
width:125px;
height:75px;
z-index:6;
}
#apDiv5 {
position:absolute;
left:500px;
top:50px;
width:125px;
height:75px;
z-index:7;
}
#apDiv6 {
position:absolute;
left:748px;
top:82px;
width:1px;
height:2px;
z-index:8;
}
#apDiv7 {
position:absolute;
left:750px;
top:50px;
width:150px;
height:75px;
z-index:8;
}
-->
</style>
<script type="text/javascript">
<!--
function MM_preloadImages() { //v3.0
var d=document; if(d.images){ if(!d.MM_p) d.MM_p=new Array();
var i,j=d.MM_p.length,a=MM_preloadImages.arguments; for(i=0; i<a.length; i++)
if (a[i].indexOf("#")!=0){ d.MM_p[j]=new Image; d.MM_p[j++].src=a[i];}}
}
//-->
</script>
</head>

<body>
<div id="apDiv1">
<p><a href="lobster.html" border=0><img src="icons/lobstericon.jpg" alt="lobster" width="100" height="100" border="0" /></a> <a href="polarbear.html"><img src="icons/polarbearicon.jpg" alt="polar bear" width="100" height="100" border="0" /></a> <img src="icons/catcollageicon.jpg" alt="cat" width="100" height="100" /> <img src="icons/inkyicon.jpg" alt="ink" width="100" height="100" /> <img src="icons/socksicon.jpg" alt="socks" width="100" height="100" /><img src="icons/oddgodicon.jpg" alt="odd god" width="100" height="100" /> <img src="icons/catsicon.jpg" alt="cats" width="100" height="100" /> <img src="icons/doeicon.jpg" alt="doe" width="100" height="100" /> <img src="icons/mouseicon.jpg" alt="mouse" width="100" height="100" /> <img src="icons/thanksicon.jpg" alt="thanks" width="100" height="100" /></p>
</div>
<div id="apDiv2"><img src="" alt="" name="octopus" width="200" height="200" id="octopus" /></div>
<div id="apDiv4"><img src="" alt="" name="about" width="200" height="75" id="about" /></div>
<div id="apDiv5"><img src="" alt="" name="blog" width="200" height="75" id="blog" /></div>
<div id="apDiv7"><img src="" alt="" name="contact" width="200" height="75" id="contact" /></div>
</body>

</html>
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
swapping divs -- when divs NOT positioned absolutely.. maya Javascript 4 11-16-2007 05:11 PM
Scaling numerical data to fit within a boundary. CBlair1986 Ruby 0 04-23-2006 09:01 AM
Managing divs within divs.... rich HTML 0 02-02-2006 07:38 PM
Force DIVs to NOT wrap if they don't fit browser width? Noozer HTML 22 01-17-2005 05:16 PM
Make wxListCtrl fit around contents and parent frame fit around listctrl Piet Python 0 07-18-2004 08:27 AM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57