经验首页 前端设计 程序设计 Java相关 移动开发 数据库/运维 软件/图像 大数据/云计算 其他经验
当前位置:技术经验 » HTML/CSS » HTML5 » 查看文章
文字属性和div容器盒的使用基础
来源:cnblogs  作者:相亲—相爱  时间:2019/1/7 9:42:19  对本文有异议
  1. 1 <!DOCTYPE html>
  2. 2 <html lang="en">
  3. 3
  4. 4 <head>
  5. 5 <meta charset="UTF-8">
  6. 6 <meta name="viewport" content="width=device-width, initial-scale=1.0">
  7. 7 <meta http-equiv="X-UA-Compatible" content="ie=edge">
  8. 8 <title>Document</title>
  9. 9 <style>
  10. 10 .center{
  11. 11 width: 200px;
  12. 12 margin: auto;
  13. 13 }
  14. 14 /* 这里是加粗文字 */
  15. 15 .p1 {
  16. 16 font-weight: bold;
  17. 17 }
  18. 18 /* 这里是倾斜文字 */
  19. 19 .p2 {
  20. 20 font-style: italic;
  21. 21 }
  22. 22 /* 这里是文字间距 */
  23. 23 .p3 {
  24. 24 letter-spacing: 10px;
  25. 25 }
  26. 26 /* 这里 是词 间距 */
  27. 27 .p4 {
  28. 28 word-spacing: 10px;
  29. 29 }
  30. 30 /* 这里是首行缩进 */
  31. 31 .p5 {
  32. 32 text-indent: 10px;
  33. 33 }
  34. 34 /* 这里是上划线 */
  35. 35 .p6 {
  36. 36 text-decoration: overline;
  37. 37 }
  38. 38 /* 这里是下划线 */
  39. 39 .p7 {
  40. 40 text-decoration: underline;
  41. 41 }
  42. 42 /* 这里是删除线 */
  43. 43 .p8 {
  44. 44 text-decoration: line-through;
  45. 45 }
  46. 46 /* 这里是衬托文字 */
  47. 47 .p9 {
  48. 48 font-family: serif;
  49. 49 }
  50. 50 /* 这里是非衬托文字 */
  51. 51 .p10 {
  52. 52 font-family: sans-serif;
  53. 53 }
  54. 54 /* 这里是容器盒的阴影 */
  55. 55 .box {
  56. 56 width: 200px;
  57. 57 height: 300px;
  58. 58 background: red;
  59. 59 box-shadow: 10px 10px 10px #ccc;
  60. 60 }
  61. 61 /* 这里是 文字的阴影 */
  62. 62 h1 {
  63. 63 text-shadow: 10px 10px 10px #ccc;
  64. 64 }
  65. 65 /* border边框属性 */
  66. 66 .border{
  67. 67 width: 200px;
  68. 68 height: 200px;
  69. 69 border-radius: 50% 50%;
  70. 70 background: yellow;
  71. 71 text-align: center;
  72. 72 line-height: 200px;
  73. 73 }
  74. 74 </style>
  75. 75 </head>
  76. 76
  77. 77 <body>
  78. 78 <div class="center">
  79. 79 <p class="p2">这里是倾斜文字</p>
  80. 80 <p class="p3">这里是文字间距</p>
  81. 81 <p class="p4">这里 是词 间距</p>
  82. 82 <p class="p5">这里是首行缩进</p>
  83. 83 <p class="p6">这里是上划线</p>
  84. 84 <p class="p7">这里是下划线</p>
  85. 85 <p class="p8">这里是删除线</p>
  86. 86 <p class="p9"> 这里是衬托文字</p>
  87. 87 <p class="p10">这里是非衬托文字</p>
  88. 88 <div class="box">这里是容器盒的阴影</div>
  89. 89 <h1>这里是文字的阴影</h1>
  90. 90 <div class="border">我是一个圆</div>
  91. 91
  92. 92 </div>
  93. 93 </body>
  94. 94
  95. 95 </html>
  1.  
 友情链接:直通硅谷  点职佳  北美留学生论坛

本站QQ群:前端 618073944 | Java 606181507 | Python 626812652 | C/C++ 612253063 | 微信 634508462 | 苹果 692586424 | C#/.net 182808419 | PHP 305140648 | 运维 608723728

W3xue 的所有内容仅供测试,对任何法律问题及风险不承担任何责任。通过使用本站内容随之而来的风险与本站无关。
关于我们  |  意见建议  |  捐助我们  |  报错有奖  |  广告合作、友情链接(目前9元/月)请联系QQ:27243702 沸活量
皖ICP备17017327号-2 皖公网安备34020702000426号