<!DOCTYPE html><html lang="zh"><head> <meta charset="UTF-8"> <title>Title</title> <style> div{ width: 300px; height: 100px; background-color: skyblue; line-height: 100px; text-align: center; border-top: 4px red solid; border-bottom: 4px red solid; border-left: 4px red solid; border-right: 4px red solid; } </style></head><body> <!--设置边框 border-边框方向:值1(边框宽度) 值2(边框颜色) 值3(边框样式) 边框宽度: 可以使用px,em,rem,不能使用百分比 边框颜色: 颜色名。16进制颜色值,rgb,rgba 边框样式: solid(实线边框) dashed(虚线边框) double(双线边框) dotted(点状边框) 边框方向: border-top(上边框) border-bottom(下边框) border-left(左边框) border-right(右边框) 如果四个边框需要有同样的样式,可以简写为border: 4px red solid; --> <div>边框设置</div></body></html>
<!DOCTYPE html><html lang="zh"><head> <meta charset="UTF-8"> <title>Title</title> <style> div { width: 100px; height: 100px; background-color: #eb87d2; line-height: 100px; text-align: center; /*border-top-left-radius: 20px 30px;*/ /*border-bottom-left-radius: 20px 30px;*/ /*border-top-right-radius: 20px 30px;*/ /*border-bottom-right-radius: 20px 30px;*/ border-radius: 50%; } </style></head><body><!--圆角边框border-值1-值2-radius: 值3 值4; 值1:上下(top,bottom) 值2:左右(left,right) 值3:水平半径 值4:垂直半径 半径的值可以使用尺寸单位 当半径只设置一个值时,另一个半径也会默认设置一样的值 当使用百分比设置半径时,半径的值是元素高度或宽度的百分比 当四个边框为同一个样式时,可以简写为border-radius(四个值): 左上角 右上角 右下角 左下角; 当四个边框为同一个样式时,可以简写为border-radius(三个值): 左上角 右上角和左下角 右下角; 当四个边框为同一个样式时,可以简写为border-radius(两个值): 左上角和右下角 右上角和左下角; 当四个边框为同一个样式时,可以简写为border-radius(一个值): 四个角;--><div>边框设置</div></body></html>
<!DOCTYPE html><html lang="zh"><head> <meta charset="UTF-8"> <title>Title</title> <style> img{ border-radius: 4px; box-shadow: 1px 1px 1px skyblue; } </style></head><body><!--边框阴影 box-shadow: 值1 值2 值3 值4 值5; 值1:水平阴影位置(正值,阴影在右,负值,阴影在左) 值2:垂直阴影位置(正值,阴影在下,负值,阴影在上) 值3:阴影模糊距离 值4:阴影的尺寸(可选值) 值5:阴影颜色(默认黑色)--><img src=""></body></html>
<!DOCTYPE html><html lang="zh"><head> <meta charset="UTF-8"> <title>Title</title> <style> div{ width: 150px; height: 100px; background: skyblue; line-height: 100px; text-align: center; border:2px solid red; border-radius: 10px; box-shadow: 1px 1px 1px gray; outline: 4px black solid; } input,textarea,select{ outline: none; } </style></head><body><!--轮廓outline: 值1 值2 值3; 轮廓加在边框之外 值1:轮廓宽度 值2:轮廓颜色 值3:轮廓样式 轮廓重置 outline: none;--><div>设置轮廓</div><input type="text"><textarea></textarea><select> <option></option></select></body></html>