html - 如何设置按钮背景图像的高度和宽度?
解决方案
你应该使用background-image
with background-size: 100%
。
button{
background-image: url("https://i.stack.imgur.com/gdaRR.png");
float :right;
width: 40px;
height: 40px;
border-radius: 50%;
background-size: 100%;
border: none;
}
<button></button>
推荐阅读
- php - 试图从命名空间加载类
- css - 如何设置全宽和响应式背景图像
- html - 响应性:div 根据内联 div 调整大小
- javascript - JavaScript 中对 socket.io 的订阅过多
- git - 如何使用命令行更新放置在我的 Github 存储库中的文件
- python - lxml html.parse 返回错误读取文件未能加载外部实体
- asp.net-core-2.0 - Visual Studio for Mac - Windows 身份验证 - 可行吗?
- reactjs - 在 graphql 查询中连接变量和字符串
- javascript - 使用 javascript 格式化值
- python - Pyside 与 python 3.6.4 不兼容吗?