缺角矩形

PPT中的形状缺角矩形
image.png
PPT中效果:
image.png

代码实现效果:
image.png

  1. <div class="zhui-alert-wrapper">
  2. <div class="zhui-alert-inner">天青色等烟雨</div>
  3. </div>
  4. .zhui-alert-wrapper {
  5. position: relative;
  6. display: inline-block;
  7. width: 30px;
  8. min-height: 100px;
  9. font-size: 12px;
  10. border-radius: 3px;
  11. background: radial-gradient(circle at bottom left, transparent 7.5px, #fff 8px) 0 100%, radial-gradient(circle at top left, transparent 7.5px, #fff 8px) 0 0, radial-gradient(circle at top right, transparent 7.5px, #fff 8px) 100% 0, radial-gradient(circle at bottom right, transparent 7.5px, #fff 8px) 100% 100%;
  12. background-size: 51% 51%;
  13. background-repeat: no-repeat;
  14. -webkit-filter: drop-shadow(0 0 1px #ff6347);
  15. filter: drop-shadow(0 0 1px #ff6347);
  16. padding: 3px;
  17. }
  18. .zhui-alert-inner {
  19. font-family: STKaiti;
  20. display: -webkit-box;
  21. display: -ms-flexbox;
  22. display: flex;
  23. -webkit-box-pack: center;
  24. -ms-flex-pack: center;
  25. justify-content: center;
  26. -webkit-box-align: center;
  27. -ms-flex-align: center;
  28. align-items: center;
  29. width: 30px;
  30. min-height: inherit;
  31. margin: 0 auto;
  32. padding: 12px 8px;
  33. word-wrap: break-word;
  34. text-align: center;
  35. -webkit-box-sizing: border-box;
  36. box-sizing: border-box;
  37. background: radial-gradient(circle at bottom left, transparent 7.5px, #fff 8px) 0 100%, radial-gradient(circle at top left, transparent 7.5px, #fff 8px) 0 0, radial-gradient(circle at top right, transparent 7.5px, #fff 8px) 100% 0, radial-gradient(circle at bottom right, transparent 7.5px, #fff 8px) 100% 100%;
  38. background-size: 51% 51%;
  39. background-repeat: no-repeat;
  40. -webkit-filter: drop-shadow(0 0 0.8px #ff6347);
  41. filter: drop-shadow(0 0 0.8px #ff6347);
  42. color: #ff6347;
  43. }

对联

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>zhui ui notice</title>
  8. <style>
  9. .zhui-notify-inner {
  10. position: relative;
  11. float: left;
  12. width: 30px;
  13. padding: 10px 8px;
  14. text-align: center;
  15. -webkit-animation: unfold .3s linear;
  16. animation: unfold .3s linear;
  17. overflow: hidden;
  18. outline: 1px solid #f7c985;
  19. outline-offset: -4px;
  20. background-image: radial-gradient(tan .4px, transparent 1px), radial-gradient(tan .4px, transparent 1px);
  21. background-size: 30px 30px;
  22. background-position: 20px 15px, -4px 0;
  23. }
  24. .zhui-notify-light {
  25. background-color: #d41d25;
  26. }
  27. </style>
  28. </head>
  29. <body>
  30. <div class="zhui-notify-inner zhui-notify-light"><span>
  31. 南风知我意吹梦到西洲
  32. </span></div>
  33. </body>
  34. </html>

image.png

纯CSS小图标预览与代码复制

https://www.zhangxinxu.com/sp/icon/css.php

image.png

参考