Wrox Programmer Forums
|
BOOK: Beginning HTML and CSS (published March 2013)
This is the forum to discuss the Wrox book Beginning HTML and CSS by Rob Larsen; ISBN: 978-1-1183-4018-9
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning HTML and CSS (published March 2013) section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 4th, 2016, 10:33 PM
Registered User
 
Join Date: Aug 2016
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default Question on Chap 3 Try it Out

Hi!
I have a quick question. In chapter 3, Try It Out, Creating Simple Links, #2 tells us to use
Code:
<nav>
element. But in #4 it is changed to
Code:
<div>
, what is the reason for that. I did it both ways and it appears the same. I know HTML is about markup, so which way is correct and why? Any answer will be helpful. Thanks
 
Old August 5th, 2016, 12:46 PM
Registered User
 
Join Date: Aug 2016
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default

Quote:
Originally Posted by stretch1dr View Post
Hi!
I have a quick question. In chapter 3, Try It Out, Creating Simple Links, #2 tells us to use
Code:
<nav>
element. But in #4 it is changed to
Code:
<div>
, what is the reason for that. I did it both ways and it appears the same. I know HTML is about markup, so which way is correct and why? Any answer will be helpful. Thanks
I recently started reading the book, I'm barely in Chapter 5, so take what I say with a grain of salt.

But this is what I know:

The <div> marker doesn't represent anything, it's only used to group several elements for styling purposes.

And the <nav> marker is almost the same, however, this one is used especifically to represent a section of a page that links to other pages or to other parts within the page. In other words you will use this marker when you want to group several links. (Hence the reason we use nav as it stands for navigation)

Like you said before, you used both markers and both worked the same, because they don't affect at all in how your page works or looks, this is for whoever reads the source code, can easily identify especific parts of the page with ease.

I hope that helped.

(I apologize if that wasn't clear enough, English is not my native language)

Last edited by Tlalok90; August 5th, 2016 at 01:00 PM..
The Following User Says Thank You to Tlalok90 For This Useful Post:
stretch1dr (August 5th, 2016)
 
Old August 5th, 2016, 09:11 PM
Registered User
 
Join Date: Aug 2016
Posts: 2
Thanks: 1
Thanked 0 Times in 0 Posts
Default

Yes, that helped a lot. I thought that was the case and I checked the source code for different web pages to see how it was use. Thanks for help and your explanation was very clear.
 
Old August 5th, 2016, 09:20 PM
Registered User
 
Join Date: Aug 2016
Posts: 2
Thanks: 0
Thanked 1 Time in 1 Post
Default

You are welcome





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chap 3 Custom View Sample Question newmvcworld_alo BOOK: Professional ASP.NET MVC 5 0 May 23rd, 2015 08:00 AM
Chap 16 Security Question missing jkoyle BOOK: Beginning ASP.NET 4 : in C# and VB 2 November 11th, 2011 08:19 PM
WebShop (Chap 9) Question about Login SDonnelly BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 3 October 19th, 2006 04:12 AM
WebShop (Chap 9) Question SDonnelly BOOK: ASP.NET 2.0 Instant Results ISBN: 978-0-471-74951-6 18 May 23rd, 2006 11:33 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.