html - CSS在jsfiddle中工作但不在我的本地服务器上?
问题描述
我最近开始了一个项目,只是为我的数字课程制作了一个临时网站。我用 CSS 制作了按钮,但由于某种原因,只有一个按钮被设置了样式。我已经正确设置了类,按钮甚至可以在 jsfiddle 中正常工作,只是不在我的网站上?
当我把它放在 jsfiddle 中时,两个按钮都可以正常工作
.button {
background-color: rgb(0, 255, 8);
border: none;
color: white;
padding: 16px 32px;
text-align: center;
text-decoration: none;
display: inline-block;
font-size: 16px;
margin: 4px 2px;
transition-duration: 0.4s;
cursor: pointer;
}
.button1 {
width: 110px;
height: 60px;
background-color: rgb(146, 255, 119);
color: black;
box-shadow: 4px 4px green;
border-radius: 40%;
font-family: 'Carter One', cursive;
font-size: 18px;
text-align: center;
}
.button1:hover {
background-color: rgb(123, 255, 0);
color: black;
font-family: 'Carter One', cursive;
border-radius: 40%;
transform: scale(1.2) rotateZ(-10deg);
}
.button2 {
width: 110px;
height: 60px;
background-color: rgb(146, 255, 119);
color: black;
box-shadow: 4px 4px green;
border-radius: 40%;
font-family: 'Carter One', cursive;
font-size: 18px;
text-align: center;
}
.button2:hover {
background-color: rgb(123, 255, 0);
color: black;
font-family: 'Carter One', cursive;
border-radius: 40%;
transform: scale(1.2) rotateZ(10deg);
}
<button class="button button1" style= "position: absolute; left: 28%; top: 207px;">SALES</button>
<button class="button button2" style= "position: absolute; left: 66.5%; top: 207px;">OTHER</button>
两个按钮都应该设置样式,但类不起作用
解决方案
推荐阅读
- django - Django selenium:i18n 部分有效
- r - NA 使用 pivot_wider
- python - 从数据集中生成 Wordcloud,仅使用一列
- python - 具有条件增量的 Python-For 循环的行为(给出错误的输出)
- c++ - 如何在 C++ 中按值从函数返回数组
- javascript - 如何连接这个数组
- flutter - 搜索页面上的颤动动画文本字段
- java - 为什么不使用 java.net.URI 验证 Camel Uri
- angular - 在 mat-tab 中读取组件的属性 'style' 显示“无法读取未定义的属性 'style'”错误消息
- java - 如何将 application.properties 转换为 application.yml 以获取地图