04.html 2.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="UTF-8">
  5. <title>Title</title>
  6. <style>
  7. #content {
  8. text-indent: 2em;
  9. box-shadow: 0px 0px 10px #999;
  10. padding: 10px;
  11. font-size: 12px;
  12. line-height: 1.5;
  13. border-radius: 5px;
  14. height: 100px;
  15. width: 250px;
  16. position: relative;
  17. margin: 200px auto;
  18. border: 1px solid #CCC;
  19. }
  20. span {
  21. position: absolute;
  22. left: 25px;
  23. height: 0px;
  24. width: 0px;
  25. }
  26. /*上部小三角实现样式开始*/
  27. span.out {
  28. line-height: 0;
  29. border-width: 10px;
  30. border-color: transparent transparent #CCC transparent;
  31. border-style: dashed dashed solid dashed;
  32. top: -20px;
  33. }
  34. span.iner {
  35. border-width: 10px;
  36. border-color: #fff transparent #FFF transparent;
  37. border-style: dashed dashed solid dashed;
  38. top: -19px;
  39. line-height: 0;
  40. }
  41. /*右部小三角实现样式开始*/
  42. span.right {
  43. background: #FFF;
  44. border-width: 1px;
  45. width: 16px;
  46. height: 16px;
  47. border-color: #CCC #CCC transparent transparent;
  48. border-style: solid solid dashed dashed;
  49. left: 270px;
  50. top: 30px;
  51. border-radius: 0 0 100% 0;/*这里radius的值不要选取绝对值因为在放大或者缩小的过程中会产生封不住口的现象*/
  52. line-height: 0;
  53. box-shadow: 5px 0 10px #aaa;
  54. }
  55. </style>
  56. </head>
  57. <body>
  58. <div id="content"> <span class="out"></span><span class="iner"></span> <span class="right"></span>
  59. <p>不管写什么内容,总之就是要实现无图小三角,要是有背景颜色那倒是极好的,没有的话也可以,就是稍微麻烦一点</p>
  60. </div>
  61. </body>
  62. </html>