+10

Old or new Html?div or semantic elements?advice!

I just started html, and while I'm using this app, I keep searching Google, the never ending loop, I wish I could just stop and continue, but at every new tag I'm presented with I search it at Google to understand it and see examples, and while this was good I also fall in a rabbit's hole, I stumbled upon the so called "semantic tags instead of <div>s because of lots of advantages and reason plus cleanliness... And I've also saw the discarding of old style html, inserting all style in CSS instead." The advise I want is if I should continue practicing old style html and use <div> element only to purposely forget about them? The thing is I don't mind knowing more and I think it's good because there are lots of docs using especially <div> element and I want to understand that. But I also don't want to get used to them. Though kinda wish I didn't know about all this until I finished studying old style html and <div>s. Sorry for long post... Really.

8/19/2019 7:54:15 PM

NakedAvocado

8 Answers

New Answer

+8

A practise i have is i break layout down into main elemens. Then i break it down using <article, or section>. This way when i come back to read the code i know exactly where i want to go faster and i can use that to identify the components easier. Ofcourse i still use id and class attributes. Then the <div> tags come in as the child elements of my <article, or section> Cheers brotha, all the best

+5

Wow.. its funny how i have come across this post and it reminds me of during my early days of learning web dev. You see i also like answers to questions when i do things, like sth has to have purpose right? To help, yeah dont worry to much about the number of <div> tags in the documemt. That is their whole purpose!, you dont have to remember each single tag you have in ur HTML code. Unless say it is relevant for sth like as you said "styling with css". And ofcourse there are other optional tags that can be used, but also needs to meet purpose. U want a new section in your page? Well a <div,section, or article> would do the trick but then seek to learn more about the HTML5 standard and what is prefered for what operation. What HTML is a markup language, just think of yourself building a structure(layout) and what you are doing with HTML is making its frame. Have i made it abit clear?

+3

I think <div> tags still have a place for generic sectioning.

+3

Sonic definitely, i still prefer to use alot of div tags than with section and article

+1

Thank you! Learning more is never a loss. I thought to study them anyways, I was just making sure:)

+1

I think this is organised! lol(will be using this for now, although I need to understand semantics more) For every tag has a use, even the discarded ones. So semantic tags with their id and class to differentiate them in CSS and Js I believe, and the <div>s nested inside semantic containers to also group, help differentiate and to organise them.

+1

0

Both!