邊框
border-width: 寬度
border-style: 樣式
border-color: transparent(透明) 顏色
border:1px solid #000; 簡(jiǎn)寫
圓角
屬性:
border-radius:5px/20%/50%;
border-top-left-radius:左上的圓角
border-top-right-radius:右上
border-bottom-left-radius:左下
border-bottom-right-radius:右下
外邊距內(nèi)邊距
外邊距:圍繞在元素周圍的空白區(qū)域默認(rèn)不被其他元素占用的
作用:拉開(kāi)元素之間的距離
語(yǔ)法:
margin:值 5px 百分比 20%;
取值(可取負(fù)值):
px 像素
% 百分比
auto(自動(dòng)) 只在左右方向有效
負(fù)值 -5px;
auto取值:
margin:0px auto;/讓一個(gè)元素水平居中/
margin:20px; 設(shè)置4個(gè)方向的外邊距
margin-top:5px;設(shè)置的是上外邊距
margin-bottom:5px;下外邊距
margin-left: 左外邊距
margin-right:右外邊距
margin:20px; 設(shè)置4個(gè)方向的外邊距
margin:10px 20px; 10px 代表上下 20px左右
margin:10px 5px 20px; 10px代表上 5px左右 20px下方向
margin:5px 10px 15px 20px; 上 右 下 左
margin:0 2px 0 0px;上右邊距
內(nèi)邊距:內(nèi)容與邊框之間的距離
語(yǔ)法:padding:
取值:
px
%;
padding:5px;四個(gè)方向的值
padding:5px 10px; 5px 上下 10px左右
padding:5px 10px 15px; 上 左右 下
padding:5px 10px 15px 20px; 上 右 下 左