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