05-padding

python学习网 2019-08-31 17:42:01

padding                                            

padding:内边距,内容到边框的距离

而且,padding是有背景颜色的。background-color属性将填充所有border以内的区域(不包括border)

padding的设置                                                    

1、分别设置不同方向的padding

  padding-top:30px;

  padding-right:30px;

  padding-bottom:30px;

  padding-left:30px;

2、综合属性

  padding:20px 30px 20px 30px;  (上、右、下、左)

  padding:20px 30px 20px;           (上、左右、下)

  padding:20px 30px;                    (上下、左右)

  padding:20px;                             (上下左右)

做网站,先清除padding                             

有些标签默认是有padding的,例如ul标签,默认有padding-left的值。

利用组合选择器

 

html, body, div, span, applet, object, iframe,
h1, h2, h3, h4, h5, h6, p, blockquote, pre,
a, abbr, acronym, address, big, cite, code,
del, dfn, em, img, ins, kbd, q, s, samp,
small, strike, strong, sub, sup, tt, var,
b, u, i, center,
dl, dt, dd, ol, ul, li,
fieldset, form, label, legend,
table, caption, tbody, tfoot, thead, tr, th, td,
article, aside, canvas, details, embed, 
figure, figcaption, footer, header, hgroup, 
menu, nav, output, ruby, section, summary,
time, mark, audio, video {
    margin: 0;
    padding: 0;
    border: 0;
    font-size: 100%;
    font: inherit;
    vertical-align: baseline;
}

 

 

使用css的引入方式中的外接样式导入即可。

 

 

 

作者:流浪者

日期:2019-08-31

阅读(2190) 评论(0)