oo7ml
04-03-2008, 07:07 AM
My main container div is 800px wide. I have a div inside that called portals which is also 800px in width (none of my divs have borders). Inside the portals div, i have 3 images that are 228px in width. I have set a margin-right:58px on the first two images so that they are evenly spread:
228 + 58 + 228 + 58 + 228 = 800px
However the 3rd image keeps collapsing under the first two images. Why is this?
Is it ok to put a div (or multiple divs) inside another div that is the same width as itself?
here is my code:
#content
{
width:800px;
margin:0px auto 0px auto;
}
#flash
{
width:800px;
height:409px;
display:block;
margin:-1px 0px 0px 0px;
}
#main
{
width:800px;
text-align:left;
display:table;
}
#portals
{
width:800px;
margin:0px 0px 20px 0px;
}
#portals img
{
width:228px;
height:223px;
}
.img_space
{
margin:0px 58px 0px 0px;
}
<div id="content">
<div id="flash">
<!--[if !IE]> -->
<object type="application/x-shockwave-flash"
data="flash/movie.swf" width="800" height="409">
<!-- <![endif]-->
<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="800" height="409">
<param name="movie" value="flash/movie.swf" />
<!--><!--dgx-->
<param name="loop" value="true" />
<param name="menu" value="false" />
</object>
<!-- <![endif]-->
</div>
<div id="main">
<div id="portals">
<img src="images/1.jpg" class="img_space" alt="1" />
<img src="images/2.jpg" class="img_space" alt="2" />
<img src="images/3.jpg" alt="3" />
</div>
</div>
</div>
thanks in advance
228 + 58 + 228 + 58 + 228 = 800px
However the 3rd image keeps collapsing under the first two images. Why is this?
Is it ok to put a div (or multiple divs) inside another div that is the same width as itself?
here is my code:
#content
{
width:800px;
margin:0px auto 0px auto;
}
#flash
{
width:800px;
height:409px;
display:block;
margin:-1px 0px 0px 0px;
}
#main
{
width:800px;
text-align:left;
display:table;
}
#portals
{
width:800px;
margin:0px 0px 20px 0px;
}
#portals img
{
width:228px;
height:223px;
}
.img_space
{
margin:0px 58px 0px 0px;
}
<div id="content">
<div id="flash">
<!--[if !IE]> -->
<object type="application/x-shockwave-flash"
data="flash/movie.swf" width="800" height="409">
<!-- <![endif]-->
<!--[if IE]>
<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
width="800" height="409">
<param name="movie" value="flash/movie.swf" />
<!--><!--dgx-->
<param name="loop" value="true" />
<param name="menu" value="false" />
</object>
<!-- <![endif]-->
</div>
<div id="main">
<div id="portals">
<img src="images/1.jpg" class="img_space" alt="1" />
<img src="images/2.jpg" class="img_space" alt="2" />
<img src="images/3.jpg" alt="3" />
</div>
</div>
</div>
thanks in advance