html - 即使我已经在 css 中设置了背景颜色、大小等,我的按钮也没有格式化
问题描述
我正在制作一个网站,我正在尝试使按钮中心对齐,无边框,但是,css 代码似乎不会影响网站
我尝试过更改类名,更改代码等。在浏览器(谷歌浏览器)上,它显示代码在样式上被“识别”但未被读取
.qwerty {
background:#f4511e;
border: none;
color: white;
padding: 16px 32px;
text-align: center;
font-size: 16px;
margin: 4px 2px;
opacity: 0.6;
transition: 0.3s;
display: inline-block;
text-decoration: none;
cursor: pointer;
}
.button:hover {opacity: 1}
<div class="column" class="Border">
<form action="aboutme.html">
<button class="qwerty">ABOUT ME</button>
</form>
</div>
按钮应该没有边框,橙色,并且在悬停时增加不透明度
解决方案
您将按钮视为一个类(在“按钮”之前有一个点的 CSS 部分中)。您可以编写以下两种中的任何一种:
// First solution
.qwerty:hover {opacity: 1}
//Second solution
button:hover {opacity: 1}
推荐阅读
- ajax - 通过 sente web-socket 通道对应该是单个请求的不间断请求
- python - 如何在 Python 中使用 Paramiko 连接到公共 FTP 服务器?
- javascript - Vanilla JavaScript for-of 循环不会完成所有迭代
- deep-learning - 损失之间的权衡?
- c++ - 未解析的外部使用 fmt::format 返回 std::wstring
- ruby - Chef-server 当目录操作删除失败时如何执行资源?
- python - 为什么在 while 循环内执行代码时显示重复输入?
- regex - 正则表达式匹配 2 个可选子字符串
- python - Django - 不同后的随机排序
- python - 有没有办法从单行输入制作字典?