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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.