Why is there div class and div Id for same section?


I saw this code in the first page of the exercise. I dont understand why we use div id=head-text? the entire text is already inside the div header
If i wanted to change the text couldnt i just select the .header?

Replace this line with your code. 

  <div class="header">
    <div id="header-text">
      <h1>Travel Like Never Before</h1>
      <h2>Whether you're looking for adventure or luxury, let us help you plan your perfect getaway.</h2>

Appreciate any input.
btw love this site thank you


It's possibly a separation of concerns. header may apply position and dimension properties (layout) along with border and background, while header-text may apply presentational styles.


ohh I see. So it would keep things neater by separating them. that makes a lot of sense.

thank you


This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.