006.前端开发知识,前端基础CSS(2020-01-21)

来源:第五天  01盒子水平居中

一、盒子中文字控制:

  1.text-align: center; /*可以让盒子内容(文字 行内元素 行内块元素)居中对齐*/

二、让盒子水平居中对齐:

  方法1.margin: 0 auto; /*通俗写法 0 auto  上下是 0  左右是auto  水平居中对齐 */

  方法2. margin-left: auto;   margin-right: auto; /*自动充满*/

  方法3.margin: auto; /* 上下左右都是auto*/

来源:第五天  02外边距合并

一、css初始化

body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, p, blockquote, th, td { margin:0; padding:0; }
body { font-size:12px; color:#666; font-family:Verdana, Microsoft YaHei, Simsun; background:#fff; line-height:24px; }
fieldset, img { border:0; }
ol, ul { list-style:none; }
h1, h2, h3, h4, h5, h6{ font-size:100%; }
em { font-style:normal; }
input, button, select, textarea { outline:none; } 
textarea { resize:none; } 
p{ text-align:justify; text-justify:distribute;}

猜你喜欢

转载自www.cnblogs.com/hzjdpawn/p/12221846.html