What's with it anyway? Div inside a div

G

greenflame

ok, so here's the deal.
I have a div, which is adjusted to 100% width and 100% height.
I have another div inside (which is relative to it)
Problem is that the outer div is adjusting to the height and width of
the inner div. It's driving me mad.
I tried to play with z-index, with overflow:hidden... nothing. maybe
you can help me.

(using windows xp, internet explorer if it matters)
Here's the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://
www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Ardeo Design Studios</title>
<style type="text/css">
body,p,tr,td {
font-family:Geneva, Arial, Helvetica, sans-serif;
font-size:17px;
}


..container {
/*z-index:1;*/
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
border:5px solid #ffffff;

}

..bgWords {
background-color:#99CCFF;
font-weight:bold; font-size:36px; color:#212121;
position:relative; top:50; left:50;
width:50%; height:150px; line-height:30px;
/* for IE */ filter:alpha(opacity=40);
/* CSS3 standard */ opacity:0.4;
/* for Mozilla */ -moz-opacity:0.4;
/*overflow:hidden; */
border:1px solid #ffffff;
}
</style>
</head>

<body bgcolor="#333333">
<div class="container">

<div class="bgWords">
aaaa aaaa aaaa baba baba baba caca caca caca dada dada dada eaea eaea
eaea fafa fafa fafa gaga gaga gaga haha haha haha iaia iaia iaia jaja
jaja jaja kaka kaka kaka lala lala lala mama mama mama nana nana nana
oaoa oaoa oaoa papa papa papa qaqa qaqa qaqa rara rara rara sasa sasa
sasa tata tata tata uaua uaua uaua uaua vava vava vava wawa wawa wawa
xaxa xaxa xaxa yaya yaya yaya zaza zaza zaza sometext sometext
sometext sometext
</div>


</div>
</body>
</html>
 
M

Matt White

ok, so here's the deal.
I have a div, which is adjusted to 100% width and 100% height.
I have another div inside (which is relative to it)
Problem is that the outer div is adjusting to the height and width of
the inner div. It's driving me mad.
I tried to play with z-index, with overflow:hidden... nothing. maybe
you can help me.

(using windows xp, internet explorer if it matters)
Here's the code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html;
charset=iso-8859-1" />
<title>Ardeo Design Studios</title>
<style type="text/css">
body,p,tr,td {
font-family:Geneva, Arial, Helvetica, sans-serif;
font-size:17px;

}

.container {
/*z-index:1;*/
position:absolute;
top:0px;
left:0px;
width:100%;
height:100%;
border:5px solid #ffffff;

}

.bgWords {
background-color:#99CCFF;
font-weight:bold; font-size:36px; color:#212121;
position:relative; top:50; left:50;
width:50%; height:150px; line-height:30px;
/* for IE */ filter:alpha(opacity=40);
/* CSS3 standard */ opacity:0.4;
/* for Mozilla */ -moz-opacity:0.4;
/*overflow:hidden; */
border:1px solid #ffffff;}

</style>
</head>

<body bgcolor="#333333">
<div class="container">

<div class="bgWords">
aaaa aaaa aaaa baba baba baba caca caca caca dada dada dada eaea eaea
eaea fafa fafa fafa gaga gaga gaga haha haha haha iaia iaia iaia jaja
jaja jaja kaka kaka kaka lala lala lala mama mama mama nana nana nana
oaoa oaoa oaoa papa papa papa qaqa qaqa qaqa rara rara rara sasa sasa
sasa tata tata tata uaua uaua uaua uaua vava vava vava wawa wawa wawa
xaxa xaxa xaxa yaya yaya yaya zaza zaza zaza sometext sometext
sometext sometext
</div>

</div>
</body>
</html>

Try reversing the position attribute on bgwords and container, so that
bgwords is absolute and container is relative. Is that what you want?
 
D

dorayme

greenflame said:
I have another div inside (which is relative to it)
Problem is that the outer div is adjusting to the height and width of
the inner div. It's driving me mad.

Your code is not formally correct, you give little clue about
what you are trying to achieve (there is mainly text on the
browser window and that is that). Why do you think you need
absolute positioning?
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,995
Messages
2,570,228
Members
46,818
Latest member
SapanaCarpetStudio

Latest Threads

Top