jege Posted July 29, 2011 Share Posted July 29, 2011 Hello. Im quite new for the css styling so I would want some help with divs. I dont really understand how to end them. like the tag is </div> but how do i know what tag i close then? Lets say ive got this kind of page with divs. How would i end the 'nav' div? just add an </div> after it? this was my problem. i didnt know what of those divs it closes? wrapper, header, headerwrapper or the nav?? <div id="wrapper"> <div id="header"> <div id="headerwrapper"> <div id="nav"> Hopefully someone got time and could make some example how they end. Thanks Quote Link to comment Share on other sites More sharing options...
WebStyles Posted July 29, 2011 Share Posted July 29, 2011 you must close them all. They are nested inside of each other, so when you type </div> you're closing the last <div> you opened. <div id="1"> <div id="2"> <div id="3"> </div> // CLOSE DIV 3 </div> // CLOSE DIV 2 </div> //CLOSE DIV 1 Quote Link to comment Share on other sites More sharing options...
DeX Posted July 29, 2011 Share Posted July 29, 2011 <div id="wrapper"> <div id="header"> <div id="headerwrapper"> <div id="nav"> </div> </div> </div> </div> Quote Link to comment Share on other sites More sharing options...
jege Posted July 30, 2011 Author Share Posted July 30, 2011 Thanks Helped me alot altough it was quite simple thing Quote Link to comment Share on other sites More sharing options...
remybink Posted July 31, 2011 Share Posted July 31, 2011 That doesn't make sense by using //close whatever this will display on the web page unless you are in php for html <div id="wrapper"> <div id="nav"> </div><!-- end nav --> </div><!-- end wrapper --> <!-- space must be used after the (--) and then the (word) followed by space then (--)> to be compliant with w3c validator You can also download PSPAD and when you click a div tag the opposing div tag will highlight Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.