AhmedLuxor / prj-rev-bwfs-dasmoto

0 stars 0 forks source link

HTML sections #2

Open martoio opened 7 years ago

martoio commented 7 years ago

Good job on separating the HTML into sections! One thing you might want to consider is changing the <div> into a <section> to improve the semantics of your code. If you aren't familiar with semantic HTML: http://www.hongkiat.com/blog/html-5-semantics/ Example:

<!-- First section -->
<section> <!-- or <div>, but <section> is more semantic -->
  <h2 class="brushes">Brushes</h2>
  <img src="#" alt="#" />
  <h3>Text</h3>
  <p>
    Lorem <span class="price">ipsum</span>
  </p>
</section>

https://github.com/AhmedLuxor/prj-rev-bwfs-dasmoto/blob/1e17526516faba9a4207ac277d8053e3d6531cad/Dasmotos_Arts_%26_Crafts/index.html#L12-L19

AhmedLuxor commented 7 years ago

but what's the difference between

and
cause in codecademy course we only got to know the
tag only , I mean when do I use div and when do I use section or I should always go for section from now on?

martoio commented 7 years ago

You use it to make your elements more meaningful. There's no visual difference between a <section> and a <div>, but if you read some code and see a <nav>, you know it's a navigation. A <div> does not give us hints to the meaning of the code.

Here's some good articles: https://www.thoughtco.com/why-use-semantic-html-3468271 https://stackoverflow.com/questions/17272019/why-to-use-html5-semantic-tag-instead-of-div http://html5doctor.com/lets-talk-about-semantics/