<button type="button" class="bottom1" onclick="location.href='./CodeVerification.html'"> <img src="images/88888.jpg" alt="" srcset="" class="img1"> <h1>验码</h1> </button> 点击跳转到的界面,botton按钮变成黄色
时间: 2023-07-19 09:39:41 浏览: 39
这个问题涉及到网页设计和CSS样式,我可以为您提供一些思路。您可以尝试在CSS样式文件中找到按钮的类名或ID名,然后添加一个新的样式,将按钮的背景颜色设置为黄色。例如:
```
.bottom1 {
background-color: yellow;
}
```
这个样式将会把类名为"bottom1"的按钮的背景颜色设置为黄色。您可以根据自己的需要修改样式。同时,如果您需要在点击按钮后立即更改样式,您可以使用JavaScript代码来实现。
相关问题
<button type="button" class="bottom1" onclick="location.href='./CodeVerification.html'"> <img src="images/88888.jpg" alt="" srcset="" class="img1"> <h1>验码</h1> </button> H5 跳转后的按钮改变颜色,具体代码
你可以在 CodeVerification.html 页面中添加以下 CSS 代码来改变按钮的颜色:
```
.bottom1 {
background-color: red; /* 改变按钮的背景色 */
color: white; /* 改变按钮的文字颜色 */
border: none; /* 去掉按钮的边框 */
padding: 10px 20px; /* 改变按钮的内边距 */
cursor: pointer; /* 鼠标悬停时显示手型光标 */
}
```
当然,你可以根据自己的喜好调整按钮的样式。
<button onclick="location.herf='sx'">刷新</button>
你的代码中有一个小错误,`location.herf` 应该是 `location.href`。
这个按钮的作用是刷新页面,你可以将 `location.href` 设置为当前页面的 URL,这样单击按钮时页面将重新加载。例如:
```html
<button onclick="location.href=window.location.href">刷新</button>
```
在这个示例中,`window.location.href` 返回当前页面的 URL,将其赋值给 `location.href` 让页面重新加载。