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 Corner the Icon by html

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

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

Editor to share with you html how to add corner marks to the icon, I believe that most people do not know much about it, so share this article for your reference, I hope you can learn a lot after reading this article, let's go to know it!

Corner marks are a good way to emphasize elements such as "New", "Popular", etc., and are often used in pictures.

The following is the use of CSS and HTML to achieve the corner effect of the picture.

Create two elements, one for the corner mark and one for the text inside the corner mark.

Popular

The angle mark must be positioned absolutely in order to achieve the effect correctly.

New!

Complete CSS code:

.flag? {

Position:?absolute

Top:?0

Left:?0

}

.flag: before? {

Content:? ""

Position:?absolute

Top:?0

Left:?0

Border-style:?solid

Border-width:?34px;?

}

.flag-text? {

-moz-transform:?rotate (- 45deg)

-ms-transform:?rotate (- 45deg)

-o-transform:?rotate (- 45deg)

-webkit-transform:?rotate (- 45deg)? translateZ (0)

Transform:?rotate (- 45deg)? translateZ (0)

Color:?#FFF

Display:?inline-block

Position:?absolute

Top:?18px

Left:?0

Z-index:?1

Font-size:?12px

Text-transform:?uppercase

Width:?50px

Text-align:?center

}

.room.is-new:before? {

Border-color:?rgba (4mem120mem0mem.9)? transparent?transparent?rgba (4Metro 120mem0mem.9)

}

.room.is-popular:before? {

Border-color:?rgba (206pd3, 5pr. 7)? transparent?transparent?rgba (206pd3, 5pr. 7)

}

The above is all the content of the article "how to Corner icons by html". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

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