Add Different Margins to Each Side of an Element


有时你想要自定义元素,使它的每一个边具有不同的 margin

CSS 允许你使用 margin-topmargin-rightmargin-bottommargin-left 来控制元素上右下左四个方向的 margin

使你的绿方块的顶部和左侧具有 40pxmargin,而底部和右侧则是 20px


给每条边添加不同的外边距给每条边添加不同的外边距

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-01-11
  • 2021-08-03
  • 2021-07-10
  • 2021-12-05
  • 2022-12-23
猜你喜欢
  • 2021-07-07
  • 2022-12-23
  • 2021-11-15
  • 2021-07-26
  • 2021-11-29
  • 2022-12-23
  • 2022-02-09
相关资源
相似解决方案