如何给图片添加按钮 |
您所在的位置:网站首页 › 注册按钮图片 › 如何给图片添加按钮 |
/* 放置按钮所需的容器。 根据需要调整宽度 */
.container { position: relative; width:
50%;} /* 使图像具有响应性 */ .container img { width: 100%; height: auto;} /* 设置按钮样式并将其放置在容器/图像的中间 */ .container .btn { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); -ms-transform: translate(-50%, -50%); background-color: #555; color: white; font-size: 16px; padding: 12px 24px; border: none; cursor: pointer; border-radius: 5px;} .container .btn:hover { background-color: black;} |
CopyRight 2018-2019 办公设备维修网 版权所有 豫ICP备15022753号-3 |