sharpest

转自:https://zhidao.baidu.com/question/344630087.html

 1 楼上说的是一种方法,yanzilisan183 
 2 <div style="margin-bottom:10px;">设下边距为10像素</div>
 3 <div style="margin-top:10px;">设上边距为10像素</div>
 4 如果两个放在一起,那中间的距离就是20像素. 也可以只指定上边DIV的下边距(或下边DIV的上边距). 
 5 
 6 ==========================可爱的分隔线============================
 7 
 8 此外,还可以用padding(内边距)来定义,padding-top:10px; padding-bottom:10px; 定义上(下)边距为10px;
 9 
10 此法的好处是,当有浮动存在的时候,可以解决ie6的双边距问题。
11 
12 两种方法视情况而定  :)

 

分类:

技术点:

相关文章:

  • 2021-12-18
  • 2022-01-13
  • 2021-05-06
  • 2021-12-20
  • 2021-09-05
  • 2022-02-18
  • 2021-12-10
猜你喜欢
  • 2021-12-20
  • 2021-12-31
  • 2021-06-23
  • 2021-08-22
  • 2021-11-23
  • 2021-10-02
  • 2021-04-07
相关资源
相似解决方案