Jump to content

Auto expanding


Andy17

Recommended Posts

Hey,

 

 

I have a container in which I have two small containers (so that I can have content to the left and right without going oldschool with tables). My problem is that the main container does not expand when one of the containers inside of it is higher. Okay, if you didn't understand that, then please look at the example below:

 

http://test.jokeheaven.eu/

 

I want the container with the black background and the solid red borders to expand when the containers inside of it do. Below is the relevant parts of my code:

 

HTML:

 

<div id="container">

<div id="leftcontent"><center><h1>Welcome to freemail4u!</h1></center>

<p>Lorem ipsum dolor sit amet and so on..............................</p>

</div>

<div id="rightcontent">right content</div>

</div>

 

CSS:

 

#container {
background-color:#000000;
margin-left:auto;
margin-right:auto;
width:80%;
text-align:center;
border: 1px solid red;
min-height:500px; /* remove after testing */
}

#leftcontent {
width:47.9%;
text-align:left;
padding:10px;
padding-top:0;
float:left;
min-height:490px; /* remove after testing */
border-right: 1px dashed red;
}

#rightcontent {
width:47.9%;
float:left;
text-align:left;
padding:10px;
padding-top:0;
min-height:490px; /* remove after testing */
}

 

 

Also, a small "bonus question": does anyone know how to make a dashed border look ok in Internet Explorer? In Firefox it is red with black background, but in IE it has white between the red dashes, which looks horrible.

 

Thanks in advance!

 

PS: This website is solely for practicing. :)

Link to comment
https://forums.phpfreaks.com/topic/168506-auto-expanding/
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.