**tag-name (followed by) .class-name** Why are these classes writen like this?

My question comes from a flexbox lesson, here i extract a piece of code:

<style>
  body {
    font-family: Arial, sans-serif;
  }
  header, footer {
    display: flex;
    flex-direction: row;
  }
  header .profile-thumbnail {
    width: 50px;
    height: 50px;
    border-radius: 4px;
  }
  header .profile-name {
    display: flex;
    flex-direction: column;

    margin-left: 10px;
  }
  header .follow-btn {
    display: flex;
    margin: 0 0 0 auto;
  }
  header .follow-btn button {
    border: 0;
    border-radius: 3px;
    padding: 5px;
  }
  header h3, header h4 {
    display: flex;
    margin: 0;
  }
  #inner p {
    margin-bottom: 10px;
    font-size: 20px;
  }
  #inner hr {
    margin: 20px 0;
    border-style: solid;
    opacity: 0.1;
  }
  footer .stats {
    display: flex;
    font-size: 15px;
  }
  footer .stats strong {
    font-size: 18px;
  }
  footer .stats .likes {
    margin-left: 10px;
  }
  footer .cta {
    margin-left: auto;
  }
  footer .cta button {
    border: 0;
    background: transparent;
  }
</style>

What i don’t understand is; why the classes are written next to “header”, like header .class-name .

Can someone explain me the reason for it?
Here i leave the lesson link

Ex.
header, class-name { } means you select header and the class class-name.
header follow-btn { } means you select just follow-btn from header.

1 Like

I see! thanks a lot! When do you suggest to use it?

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