Refactor the spacing between <header>, <article>, and <aside> so that elements will have a 20px margin above and below, regardless of their order on the page. Account for collapsing margins and use shorthand syntax.

header, article, aside {
  margin: 20px 0;
}

 

Add a 20px bottom margin to <header>, <article>, and <aside> using the shorthand syntax. Remove any top margins and keep in mind that with top and bottom padding, the margins will no longer collapse.

header, article, aside {
  padding: 10px;
}
article {
  margin: 20px 0;
}

---> Change to----->

header, article, aside {
  padding: 10px;
  margin: 0 0 20px 0;
}

 

相关文章:

  • 2022-12-23
  • 2021-06-25
  • 2021-10-13
  • 2022-12-23
  • 2022-12-23
  • 2021-08-19
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-10-19
  • 2021-12-25
  • 2021-07-18
  • 2022-12-23
  • 2022-12-23
  • 2021-08-29
  • 2022-12-23
相关资源
相似解决方案