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

<PLEASE USE THIS TEMPLATE TO HELP YOU CREATE A GREAT POST!>

https://www.codecademy.com/courses/learn-html-css/lessons/ids-classes-divs/exercises/maintainable-code?action=lesson_resume

<Below this line, in what way does your code behave incorrectly? Include ALL error messages.>

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.

Travel Like Never Before

Whether you're looking for adventure or luxury, let us help you plan your perfect getaway.

```

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

1 Like

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