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 Link to comment https://forums.phpfreaks.com/topic/243157-div-ids-classes/ 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 Link to comment https://forums.phpfreaks.com/topic/243157-div-ids-classes/#findComment-1249015 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> Link to comment https://forums.phpfreaks.com/topic/243157-div-ids-classes/#findComment-1249143 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 Link to comment https://forums.phpfreaks.com/topic/243157-div-ids-classes/#findComment-1249345 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 Link to comment https://forums.phpfreaks.com/topic/243157-div-ids-classes/#findComment-1249653 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.