Thread: CSS Positioning

View Single Post

  #2 (permalink)  

Old 02-18-2006, 11:28 AM

Re: CSS Positioning

Hey, Image's are treated like TEXT for html. By Default they display in-line, or on the same line of text. So, to get them side by side all you have to do is put them right next to each other in html. To center them, you have to contain them in a div which is 2x the width of the images and then add margin:auto; to that div.

Code:
<style type="text/css">
<!--
#pos1 {
text-align:center; /* centers the images */
width:600px; / *set to the width of the combined images */
margin:auto; /* this centers the containing div */
}

#pos1 img {
float:left;
padding:0;
height:300px;
width:190px;
}


#container1 {
padding:0;
}
-->
</style>
<body>
<div id="container1">
<div id="pos1"><img src="part1.jpg" alt="" /><img src="part2.jpg" alt="" /></div>
</div>
This should work, if it doesnt let me know because I didnt test it.
__________________
Audi Videos | MySpace Layouts | About Me | Kid Sniffles
[ reply ]
missionsix

missionsix is offline patandrew.com

missionsix's Avatar

Join Date: Feb 2004

Location: under you.

Posts: 4,860

Send a message via AIM to missionsix Send a message via MSN to missionsix