Blogger Information
Blog 67
fans 0
comment 2
visits 71993
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
css边框带箭头,方便修改上下左右。
搁浅
Original
956 people have browsed it

原理是利用::before的内容去定位遮挡::after的内容,不能全部遮挡完,预留和边框一样大的PX.

下面可以修改注释的‘控制位置PX’来定位上下左右,实现上下左右箭头。

  1. <style>
  2. .con {
  3. background: white;
  4. border: 1px solid #D9E0E6;
  5. padding: 20px;
  6. position: relative;
  7. border-radius: 3px;
  8. width: 400px;
  9. }
  10. .con::after {
  11. display: block;
  12. content: "◆";
  13. position: absolute;
  14. font-size: 26px;
  15. left: 105px;/*控制实心箭头处左边位置*/
  16. bottom: 24px;/*控制实心箭头处底边位置*/
  17. color: white;
  18. }
  19. /*注意:此处::before的content要比::after的bottom高1px,就形成了箭头视觉效果了*/
  20. .con::before {
  21. display: block;
  22. content: "◆";
  23. position: absolute;
  24. font-size: 26px;
  25. left: 105px;/*控制空心箭头处左边位置*/
  26. bottom: 25px;/*控制空心箭头处底边位置*/
  27. color: #D9E0E6;
  28. }
  29. </style>
  30. <div class="con"></div>
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post