Welcome!

By registering with us, you'll be able to discuss, share and private message with other members of our community.

SignUp Now!
  • Guest, before posting your code please take these rules into consideration:
    • It is required to use our BBCode feature to display your code. While within the editor click < / > or >_ and place your code within the BB Code prompt. This helps others with finding a solution by making it easier to read and easier to copy.
    • You can also use markdown to share your code. When using markdown your code will be automatically converted to BBCode. For help with markdown check out the markdown guide.
    • Don't share a wall of code. All we want is the problem area, the code related to your issue.


    To learn more about how to use our BBCode feature, please click here.

    Thank you, Code Forum.

HTML & CSS Do you use <nav>, <article>, <footer>?

Malcolm

Administrator
Administrator
Staff Team
Code Plus
Company Plus
Hello Coders!

I'm just curious rather or not you use HTML tags such as <nav>, <article> and such. I have never used them besides <nav> but do they help? How exactly can they be used?
 
Yes, I use these elements wherever they are suitable.

These are semantic elements. They generally do not give any special style to its content, rather they are there to define/give meaning to the content they are holding. There is no special way of using them. You can just wrap your navigation links within a <nav>...</nav> element, put your page header or blog post title inside <header>...</header> element, put your blog/article content inside <article>..</article>, put phrases within <em>...</em> if you want to emphasis them and so on...

It is especially useful to non-human users of HTML documents, like search engine crawlers. So while crawling through a page, search bots can easily figure out where the navigation is and where the main content/article is and where is the header information so that it can utilize only the suitable content for their indexing algorithms. Apart from search bots, any other softwares or devices may look for these semantic elements to provide better experience to its users.

HTML coders should learn meaning of all such semantic tags and use them wisely to make their pages more meaningful, more compliant and more search engine friendly. However, not all tags are semantic. Some tags like <b> and <i> do not give any special meaning to its content, rather they are there just for presentational purpose.
 
I've only used <article>. Nothing else.

I'm 100% sure that <article> is used for when you're writing News/Blog Posts on your Site. I don't see it serving any other purpose.
 
Huh. So it is. I thought it was only for other things such as Blog Posts but turns out not. That is another way to use it though.
 
So these tags are just to help organize your code
Yeah, pretty much. I primarily use <article> for Blog-Posts and in my opinion, it makes everything a lot tidier. Although, I'm pretty sure it will be even more tidier if you nest them inside a <div>.
and to help search engine crawlers understand what's what?
You know, I'm not really good with SEO so I can't say for certain. I mean, on a Search-Engine like Bing, Google or DuckDuckGo, at the bottom of a Link will be the URL and some Text. But the Text will display a small bit of info from that Site.

So if I were to Search up something on DuckDuckGo, I would get something like this:
Screenshot at 2019-09-29 12-43-22.png
And as I said, there will be the Link, URL and some Text about the Page/Site. Although, for Text to be displayed, I think you need to use <meta>. I'm not exactly sure though.
 
Yeah, pretty much. I primarily use <article> for Blog-Posts and in my opinion, it makes everything a lot tidier. Although, I'm pretty sure it will be even more tidier if you nest them inside a <div>.
That's great to know! Thank you a lot @Dan-Kode :)
You know, I'm not really good with SEO so I can't say for certain. I mean, on a Search-Engine like Bing, Google or DuckDuckGo, at the bottom of a Link will be the URL and some Text. But the Text will display a small bit of info from that Site.

So if I were to Search up something on DuckDuckGo, I would get something like this:
Screenshot at 2019-09-29 12-43-22.png

And as I said, there will be the Link, URL and some Text about the Page/Site. Although, for Text to be displayed, I think you need to use <meta>. I'm not exactly sure though.
So anything within your <meta> tags will be used to display on Google and other search engines?
 
That's great to know! Thank you a lot @Dan-Kode
No problem. Although, I would recommend asking someone like @joe for more details on this Subject. While I may be good with HTML, some parts like these, I'm not so good with.
So anything within your <meta> tags will be used to display on Google and other search engines?
As far as I'm aware, yes. W3Schools has this Page for the <meta> Tag. There's a <meta> Tag in the block of code that is displayed that has an Attribute of name. And then an Attribute of content. And inside content, is a small description. But as I said, I would recommend asking @joe about this.
 
@joe @Dan-Kode So these tags are just to help organize your code and to help search engine crawlers understand what's what?

The semantic tags are mainly for giving a meaning to the content inside them. And this meaningful markup can be helpful to search engines and other softwares equally.

An organized code is just a byproduct of using semantic elements.

Generally it is seen that Google search results show text that we put as our meta tag description, but in case it is not present, search engine may choose to lift piece of text from our article tag for this purpose. Its upto them. And they keep updating their strategy so I am not fully sure.
 
The semantic tags are mainly for giving a meaning to the content inside them. And this meaningful markup can be helpful to search engines and other softwares equally.

An organized code is just a byproduct of using semantic elements.

Generally it is seen that Google search results show text that we put as our meta tag description, but in case it is not present, search engine may choose to lift piece of text from our article tag for this purpose. Its upto them. And they keep updating their strategy so I am not fully sure.
Thank you! I really appreciate the help!
 

New Threads

Latest posts

Buy us a coffee!

Back
Top Bottom