Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use pseudo-class after to implement triangular Arrow in css

2025-03-01 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/01 Report--

Editor to share with you how css uses pseudo-class after to achieve triangular arrows. I hope you will get something after reading this article. Let's discuss it together.

Triangular arrowhead of pseudo-class after implementation

Implementation principle: set the border on three sides, the border in the direction pointed by the arrow does not need to be set, the border color on both sides of the arrow is transparent (transparent), and the opposite side is the main border color (larger) / main background color (smaller), because we need a triangular arrow with frame color. When the first arrow (larger) is accurately covered by the second arrow (smaller), the uncovered edge is the border of the composite triangular arrow, and its color is the color of the larger triangular arrow, which is adjustable. On the other hand, the color of the smaller triangular arrow should be set to the main color, and the frame of the main body should be covered when the negative positioning offset is made, so that it will be combined with the main body.

.arrow-left:before {z-index: 9999; content: "; display: block; width: 0; height: 0; border-top: 20px solid transparent; border-bottom: 20px solid transparent; border-right: 20px solid # E9E9E9; position: absolute; left:-20px; top: 80px;}

After reading this article, I believe you have a certain understanding of "how css uses pseudo-class after to achieve triangular arrows". If you want to know more about it, you are welcome to follow the industry information channel. Thank you for reading!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report