CSS把文字限制在圆形内–转载

木子 电脑网络评论183阅读模式
点击复制

  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>CSS把文字限制在圆形内</title>
  5. <meta charset="utf-8">
  6. <style type="text/css">
  7. .circle {
  8. border-radius: 50%;
  9. width: 150px; height: 150px;
  10. color: white;
  11. background-color: deepskyblue;
  12. text-shadow: 1px 1px rgba(0,0,0,.5);
  13. padding: 10px;
  14. text-align: justify;
  15. }
  16. before {
  17. float: left;
  18. width: 50%; height: 100%;
  19. shape-outside: radial-gradient(farthest-side ellipse at right, transparent 100%, red);
  20. /* background: radial-gradient(farthest-side ellipse at right, transparent 100%, red); */
  21. }
  22. after {
  23. float: right;
  24. width: 50%; height: 100%;
  25. shape-outside: radial-gradient(farthest-side ellipse at left, transparent 100%, red);
  26. /* background: radial-gradient(farthest-side ellipse at left, transparent 100%, red); */
  27. }
  28. </style>
  29. </head>
  30. <body>
  31. <p class="circle">
  32. <before></before><after></after>
  33. 在CSS Shapes布局问世之前,文字像杂志一样的任意形状的排版几乎是不可能的。
  34. </p>
  35. </body>
  36. </html>

我的微信
微信扫一扫
weinxin
13832413877
我的微信公众号
微信扫一扫
weinxin
我的公众号
 
匿名

发表评论

匿名网友
:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

拖动滑块以完成验证