Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

You don't need the classes on the alert sub-elements:

  <div class="alert">
    <img src="/img/logo.svg" alt="ChitChat Logo" />
    <div>
      <h2>ChitChat</h2>
      <p>You have a new message!</p>
    </div>
  </div>
Then the CSS is just:

  .alert {...}
  .alert img {...}
  .alert h2  {...}
  .alert p   {...}
You can probably also get rid of the nested div by using flex, floats, or margins.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: