Dasmoto's html code

Hello all!

I have just completed Dasmoto’s Arts & Crafts project. While I did successfully complete it - except for a few spelling errors, I found that the overall length of my code was shorter than the finished version Codecademy provided afterwards to compare. I noticed that I didn’t use the div tag once, but it didn’t really hinder me or my understanding in any way. In fact, I thought the HTML code looked more organised without it. Should I focus on incorporating the div tag as it is shown to be used, or is it more so up to the individual and safe to not get into such a habit?

Hi, there!

Welcome to the forums!

Because this is a very straightforward project, I do not see why <div>s would be needed, and the use of the <div> tag is certainly up to the individual. However, the <div>s being used are grouping each product being “sold.” In a more complicated layout, grouping each product along with its relevant information would be needed to keep them together. In future lessons, you will also learn about semantic elements, which will take over <div> in most cases.

But <div> still serves a purpose in grouping and styling elements, and it’s best to get an understanding of its best use cases.

Overall for this project, if it looks like the spec (with or without <div>s), then you did it!

Great job! :slight_smile:


Thank you! That’s really reassuring! :smiley: