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 does CSS imitate the remote control button

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "how CSS imitates remote control buttons". The explanation in this article is simple and clear and easy to learn and understand. Please follow the editor's train of thought to study and learn "how CSS imitates remote control buttons".

Html structure

+ +-- ok

Css style

.button-group {padding-top: 20rpx; width: 300rpx; height: 300rpx; background-color: pink;}. Outter-circle {position: relative; margin-left: 10rpx; width: 280rpx; height: 280rpx; background-color: lightcyan; border-radius: 100%; overflow: hidden; transform-origin: center; transform: rotate (45deg);} .inner-parts {float: left; width: 140rpx; height: 140rpx; line-height: 140rpx; text-align: center Silver {background-color: silver;}. Gold {background-color: gold;}. Blue {background-color: blue;}. Brown {background-color: brown;}. Inner-circle {position: absolute; margin-top: 70rpx; margin-left: 70rpx; width: 140rpx; height: 140rpx; line-height: 140rpx; text-align: center; border-radius: 100%; background-color: lightblue;}. Rotate {display: inline-block; transform: rotate (- 45deg);}

Note: if the text area is not inline-block, the rotation attribute will not take effect!

Button click event

Button: function (e) {var buttonType = e.currentTarget.dataset.type console.log (buttonType) switch (buttonType) {case 'chaAdd': console.log (' backward the channel') break case 'chaDes': console.log (' forward the channel') break case 'volAdd': console.log (' strengthen the volumn') break case 'volDes': Console.log ('weaken the volumn') break default: console.log (' ok')}}

Running effect

Thank you for reading, the above is the content of "how CSS imitates remote control buttons". After the study of this article, I believe you have a deeper understanding of how CSS imitates remote control buttons, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

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

Internet Technology

Wechat

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

12
Report