Forum Moderators: not2easy

Message Too Old, No Replies

Using a div-container inside another one

         

Makaveli2007

10:59 pm on Dec 14, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



I just created buttons for my vertical menue. It has some simple effects (colors changing, text appearing to be pushed down).

However, I decided to try out something else I've seen elsewhere: adding a border to the left side to those buttons, which changes it's color accordingly if the button gets pushed.

For this other effect I decided to add I used another <div id="xyz"></div> - tag inside the first div-tag so I can use the ID xyz for this effect..and delete it quickly if I do not want it anymore.

I'm still a beginner and am wondering if doing this would be a good or a rather bad idea, because technically there are two "boxes"..one inside another one..is that not considered good practice or is it okay?

thanks!

ratman7

11:09 pm on Dec 14, 2007 (gmt 0)

10+ Year Member



It is ok to nest div elements, if that is what you are asking. Try to code semantically though -- in other words, don't use a <div> where an <li> or <p> would be more appropriate.

Makaveli2007

12:00 am on Dec 15, 2007 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi,

thanks for the reply. I just decided to remove the second div-element and got the effect to work differently, because I was sure it'd be unnecessary to make it easier to remove than anything else on the site.