Karatesaurus-Rex / prj-rev-bwfs-dasmoto

0 stars 0 forks source link

Div structure #2

Open farishkash opened 7 years ago

farishkash commented 7 years ago

I am not sure on why you are using this approach for your headings.

Are you just putting the h2 in the div for the sake of css?


<div id="brushes">
      <div class="bg1"><h2>Brushes</h2></div>

You can just write this as

<div id="brushes">
   <h2>Brushes</h2>

and then change your css to target this as

#brushes h2 {
  background-color: mediumspringgreen;
}

or you can just assign each heading a class


<div id="brushes">
      <h2 class="bg1">Brushes</h2>

The extra div for just heading isn't necessary.

Karatesaurus-Rex commented 7 years ago

Yes I needlessly divided things thinking "separating everything will make it easy to read and give it good structure"! And you absolutely read my intent clearly, it was just for the sake of css indeed. I completely forgot about using more than one selector to target the heading within the "brushes" ID, and instead cluttered the code with more div elements.

Thank you for showing me some more intuitive ways to use css selectors!