Hey there! Sign in to join this conversationNew here? Join for free
    • Thread Starter
    Offline

    9
    ReputationRep:
    I just recently started this course and we are doing the web developing section, using html and css.

    We were looking at how to make the main frame of a web page (Where the images goes, text goes). We were introduced to the div tag and nav tag but what exactly is their function ?
    Offline

    3
    ReputationRep:
    The <div> tag defines a division or a section in an HTML document.The <div> tag is used to group block-elements to format them with CSS.
    The <nav> tag defines a set of navigation links.Notice that NOT all links of a document should be inside a <nav> element. The <nav> element is intended only for major block of navigation links.Browsers, such as screen readers for disabled users, can use this element to determine whether to omit the initial rendering of this content.
    Offline

    6
    ReputationRep:
    <div> tags can be viewed as containers. They are used to group certain elements of a web page together. For example, a basic HTML document might look like:

    <html>
    <head>
    </head>
    <body>
    <div id="container">
    <div id="header">
    // You'd place your page header here
    </div>
    <div id="content">
    // You'd place your page content here
    </div>
    <div id="footer">
    // You'd place your footer here
    </div>
    </div>
    </body>
    </html>

    As you can see, there are 4 div elements. The first encapsulates all the elements within the page. The second encapsulates all of the header elements. Third, all of the content elements. And lastly, all of the footer elements.

    Without style, this doesn't look like much. But, adding style to a div element (even if it's something as simple as a background color, positioning, and some borders) will bring the page to life and it will start looking a little more like an actual web page.

    The nav tag is used to mark a set of links as the main navigation links for the page.

    Hope this helps
    • Thread Starter
    Offline

    9
    ReputationRep:
    (Original post by life.of.pablo)
    The <div> tag defines a division or a section in an HTML document.The <div> tag is used to group block-elements to format them with CSS.
    The <nav> tag defines a set of navigation links.Notice that NOT all links of a document should be inside a <nav> element. The <nav> element is intended only for major block of navigation links.Browsers, such as screen readers for disabled users, can use this element to determine whether to omit the initial rendering of this content.
    THANKS

    (Original post by sameehaiqbal)
    <div> tags can be viewed as containers. They are used to group certain elements of a web page together. For example, a basic HTML document might look like:

    <html>
    <head>
    </head>
    <body>
    <div id="container">
    <div id="header">
    // You'd place your page header here
    </div>
    <div id="content">
    // You'd place your page content here
    </div>
    <div id="footer">
    // You'd place your footer here
    </div>
    </div>
    <script type="text/javascript">window.NREUM||(NREUM ={});NREUM.info={"beacon":"bam.n r-data.net","licenseKey":"6d735935 d6","applicationID":"3122487,312 2488","transactionName":"ZFQAZkY FX0tYU0JZW10eN0BdS1BSWEgYQFxD"," queueTime":0,"applicationTime":7 2,"atts":"SBMDEA4fTEU=","errorBe acon":"bam.nr-data.net","agent":""}</script></body>
    </html>

    As you can see, there are 4 div elements. The first encapsulates all the elements within the page. The second encapsulates all of the header elements. Third, all of the content elements. And lastly, all of the footer elements.

    Without style, this doesn't look like much. But, adding style to a div element (even if it's something as simple as a background color, positioning, and some borders) will bring the page to life and it will start looking a little more like an actual web page.

    The nav tag is used to mark a set of links as the main navigation links for the page.

    Hope this helps
    Wow, that really helps. We have been looking at website wireframes and our task is to make the wire frame using html and css, I never really understood what the div tag did but now I do
    You never fail to give me a great explanation !
 
 
 
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • Poll
    Would you rather give up sugar, or salt?
    Applying to university
  • See more of what you like on The Student Room

    You can personalise what you see on TSR. Tell us a little about yourself to get started.

  • The Student Room, Get Revising and Marked by Teachers are trading names of The Student Room Group Ltd.

    Register Number: 04666380 (England and Wales), VAT No. 806 8067 22 Registered Office: International House, Queens Road, Brighton, BN1 3XE

    Write a reply...
    Reply
    Hide
    Reputation gems: You get these gems as you gain rep from other members for making good contributions and giving helpful advice.