Jump to content

Nesting <div> problems


Eivo
 Share

Recommended Posts

I am having troubles nesting <div> tags. I am creating my layout and I need to nest a <div> layer inside another <div> layer. I got it to work once will testing it, then tried to impliment it into my layout and the parent <div> layer is a no-show. Is there a limit to how far you can nest these tags or something that I may be missing. I think it has to do with the position style.

<div id="shell" style="z-index:0; position:absolute; width:819px; left:102px; top:0px; visibility:visible; background-color:#999999">Text<div id="story" style="z-index:1; position:absolute; width:615px; left:204px; visibility:visible; background-color:#666666">Text</div></div>

I just noticed that it works in IE7 but not FF2Anyone know of a work around or why FF2 doesn't nest tags correctly?

Link to comment
Share on other sites

No, there is no limit. You're not really nesting them... well they are nested but the inline style you added to the nested <div> is absolute which means it can move anywhere on the page regardless if it is nested or not. Lose the position:absolute; and left:204px; on the nested <div>. After that you can adjust the nested <div> anywhere inside the parent <div> with a little css.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...