css - 由输入元素实现的按钮在点击时不响应
问题描述
开发快应用时,将输入元素的类型设置为按钮并设置border-radius属性后,点击时按钮没有按预期响应(背景颜色变化)。如果删除了border-radius 属性,按钮将再次正常工作。
<template>
<div class="page-wrapper">
<input type="button" class="button" value="Animation" />
</div>
</template>
<script>
</script>
<style>
.page-wrapper {
flex-direction: column;
justify-content: center;
align-items: center;
}
.button {
color: #20a0ff;
background-color: red;
padding: 10px 20px;
border-radius: 40px;
}
</style>
如何在快应用按钮中使用边框半径 CSS 功能。
解决方案
设置border-radius属性后,由于快应用引擎底层的限制,无法自动实现点击效果。
设置border-radius属性后,可以使用快应用的伪类来实现按键点击效果。
.button:active{
background-color: green;
}
推荐阅读
- tensorflow - 为什么手动构建 timestep-unfold LSTM 与使用 static_rnn 有不同的输出?
- javascript - 无法在 three.js 中使用 FBXLoader
- flutter - 如何使用用户的特定 ID 传递结果?
- node.js - req.file 在控制台中显示未定义
- java - 执行其他行后正在运行方法
- python - 从 sophos UTM 9 获取用户和用户详细信息的 Python API 代码
- reactjs - 在 React 中等待 useState
- java - 如何在不使用位置的情况下不同的打开活动
- python - ActionChains 中的 perform() 和 reset_actions() 不起作用 selenium python
- reactjs - How to check if my Google Drive embed videos using iframe ends?