August 24th, 2003, 09:52 AM
CSS question: DIVs within DIVs possible?
Is it possible to put a DIV within a DIV? I have a complex layout that will require a background DIV, and then multiple superimposed DIVs on top. It would be easy for me to just use absolute layout and z-index layering, but the problem is I need the background DIV to wrap around all the inside DIVs. In english: I need the background DIV to scale depending on the text withing the embedded DIVs. If that makes any sense. I tried testing embedded DIVs in IE and Mozilla but nothing happened. Is there an alternative to this? I don't really want to use HTML tables within DIVs... kinda makes the whole CSS positioning thing kinda worthless.
Here's my source:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
border-top: 0px none;
border-right: 2px solid #999999;
border-bottom: 0px none;
border-left: 2px solid #999999;
<div class="annoucement">This is the annoucement.</div>
Last edited by phatnadz; August 24th, 2003 at 10:01 AM.
August 24th, 2003, 02:22 PM
yeah, from what im aware of, it should work, but just be careful when you put more than 3 divs within a 'parent' div, cuz thats where you start to lose track of your ending tags(</div>).
August 24th, 2003, 07:44 PM
Oops (bloody typos)!
Hope this helps,