Quote:
Originally Posted by stretch1dr
Hi!
I have a quick question. In chapter 3, Try It Out, Creating Simple Links, #2 tells us to use
element. But in #4 it is changed to
, 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)