5.边框.html 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1.0">
  6. <title>Document</title>
  7. <style>
  8. /*
  9. 类选择器
  10. 在body标签中
  11. 在开始标签里 通过class="名字"
  12. 在style标签里
  13. .名字 {样式...}
  14. */
  15. .box {
  16. width: 200px;
  17. height: 200px;
  18. /* 边框
  19. 复合属性
  20. border: width style color;
  21. border-width 边框粗细
  22. border-style 边框样式
  23. dashed 虚线
  24. solid 实线
  25. dotted 点线
  26. double 双线
  27. border-color 边框颜色
  28. border-top 边框上
  29. border-right 边框右
  30. border-bottom 边框下
  31. border-left 边框左
  32. 圆角边框:
  33. border-radius
  34. 50% 圆形
  35. border-top-left-radius 左上角圆角
  36. border-top-right-radius 右上角圆角
  37. border-bottom-left-radius 左下角圆角
  38. border-bottom-right-radius 右下角圆角
  39. */
  40. border: 1px solid #000;
  41. border-width: 10px;
  42. border-style: solid;
  43. border-color: #0f0;
  44. border-bottom: 1px solid #f00;
  45. border-radius: 50%;
  46. /* border-top-left-radius: 20px; */
  47. }
  48. input {
  49. /*
  50. 轮廓 outline 所有属性都与border一致
  51. */
  52. outline: 2px dashed #f00;
  53. /* outline: none; */
  54. /* border: none; */
  55. }
  56. </style>
  57. </head>
  58. <body>
  59. <input type="text">
  60. <div class="box"></div>
  61. </body>
  62. </html>