<div> problem

liunx

Guest
is it possible to put a div inside a div?<!--content-->Yes, this is possible.<br />
<br />
<br />
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" <br />
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"><br />
<br />
<html><head><title>Nested <div>'s</title><br />
<meta http-equiv="Content-Type"<br />
content="application/xhtml+xml; charset=iso-8859-1" /> <br />
<meta http-equiv="Content-Style-Type" content="text/css" /><br />
<meta http-equiv="Content-Language" content="en-us" /><br />
<meta name="rating" content="general" /><br />
<style type="text/css"><br />
<!--<br />
body {<br />
margin:0;<br />
padding:1em;<br />
font-size:100%;<br />
}<br />
<br />
#one {<br />
width:15em;<br />
height:15em;<br />
padding:0.3em;<br />
margin:0;<br />
border:2px solid #000;<br />
}<br />
<br />
#two {<br />
float:right;<br />
border:1px solid #000;<br />
width:7em;<br />
height:5em;<br />
}<br />
--><br />
</style><br />
</head><br />
<br />
<body><br />
<br />
<div id="one"><br />
<div id="two">Nested <div></div><br />
Outside <div><br />
</div><br />
<br />
</body><br />
</html><!--content-->to be a little more specific i want<br />
<br />
<div id="gangsters" style="visibility:visible"><input name="button" type="button" onclick="do_totals1();fightga()" value="Gangsters" /><br />
</div><div id="martialartists" style="visibility:hidden"><input type="button" value="Martial Artists" onclick="do_totals1();fightma()"><br />
</div><div id="friezasguardians" style="visibility:hidden"><input type="button" value="Frieza's Guardians" onclick="do_totals1();fightfg()"><br />
</div><div id="friezashenchmen" style="visibility:hidden"><input type="button" value="Frieza's Henchmen" onclick="do_totals1();fightfh()"><br />
</div><div id="ginyuforce" style="visibility:hidden"><input type="button" value="Ginyu Force" onclick="do_totals1();fightgf()"><br />
</div><div id="frieza" style="visibility:hidden"><input type="button" value="Frieza" onclick="do_totals1();fightfr()"><br />
</div><div id="kingcold" style="visibility:hidden"><input type="button" value="King Cold" onclick="do_totals1();fightkc()"><br />
</div><div id="DrGero" style="visibility:hidden"><input type="button" value="Dr. Gero" onclick="do_totals1();fightdg()"><br />
</div><div id="android18" style="visibility:hidden"><input type="button" value="Android 18" onclick="do_totals1();fight18()"><br />
</div><div id="android17" style="visibility:hidden"><input type="button" value="Android 17" onclick="do_totals1();fight17()"><br />
</div><div id="celljr" style="visibility:hidden"><input type="button" value="Cell Jr." onclick="do_totals1();fightcj()"><br />
</div><div id="cell" style="visibility:hidden"><input type="button" value="Cell" onclick="do_totals1();fightce()"><br />
</div><div id="completecell" style="visibility:hidden"><input type="button" value="Complete Cell" onclick="do_totals1();fightcc()"><br />
</div><div id="buu" style="visibility:hidden"><input type="button" value="Buu" onclick="do_totals1();fightbu()"><br />
</div><div id="brolly" style="visibility:hidden"><input type="button" value="Brolly" onclick="do_totals1();fightbr()"><br />
</div><br />
<br />
<br />
<br />
alllll that to be inside<br />
<div id="battles" style="visibility:visible"><br />
Fight With:</div><br />
<br />
<br />
if that isnt too complicated (=<!--content-->It's ugly but it's not complicated. ;-) Nested divs are used all the time.<!--content-->could you explain this a little better<!--content-->Pardon my thickness, but I don't exactly see what your problem is... :confused:<!--content-->You want to wrap all that stuff in a div so you prepend <div id="battles" style="visibility:visible"> to it and append </div> to it and you're done.<!--content-->well i have all that code in the div and when i change the div to hidden that code stays on the page<!--content-->I'm still not exactly sure what you're trying to do, but the reason the Button stays is because you've got this line of got in there:<br />
<br />
<div id="gangsters" style="visibility:visible"><input name="button" type="button" onclick="do_totals1();fightga()" value="Gangsters" /><!--content-->
 
Back
Top