Blogger Information
Blog 14
fans 0
comment 0
visits 9574
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
一个盒子的border padding margin的用法 简写用法 7.4
耿玉洁的博客
Original
522 people have browsed it

写代码的时候 经常会用到简写方法

padding的正常写法

padding-top: 20px;
padding-right: 30px;
padding-bottom: 40px;
padding-left: 50px;

简写方式:

padding: 20px 30px 40px 50px;  方向是:上右下左

如果上下一样 则  padding: 20px 30px 50px;

如果左右一样 则  padding: 20px 30px 40px;

如果上下数值一样,左右数值一样,但上下与左右数值又不一样 则  padding: 20px 30px;

如果全部一样 则 padding: 20px;

margin的方式与padding一致

border的正常写法

border-top-style: solid;
border-top-color: red;
border-top-width: 5px;

border-right-style: solid;
border-right-color: red;
border-right-width: 5px;

简化写法

border-top: 5px solid red;

如果上下左右都一样则 border:5px solid red;


Correction status:qualified

Teacher's comments:总结的不错, 重点在于记住, 并应用在工作中
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post