Jump to content

div ids & classes.


jege

Recommended Posts

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
Share on other sites

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
Share on other sites

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
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.