html - 使用 css 定位与其他东西具有相同类的东西

标签 html css

我想定位一个似乎与另一个按钮具有相同类的按钮。当我无法更改 html 时,有没有办法区分使用 css?

在此 page提交按钮消失了,但我认为这是因为我隐藏了一个共享同一类的按钮 here

HTML:

<button type="submit" class="btn button ur-submit- 
button">
<span></span>Submit</button>

最佳答案

我可以看到具有以下属性的通用类 .btn:

.btn.btn {
    color: transparent! important;
    background: transparent! important;
    border: none! important;
}

尝试通过添加以下 CSS 添加类选择器 .ur-submit-button 来覆盖类的隐藏属性:

button.btn.button.ur-submit-button {
    color: initial !important;
    /* background: initial !important; */
    /* border: initial !important; */
}

它将显示按钮,然后您可以使用相同的选择器进一步修改其外观。

虽然 !important 的用法不是一个好习惯,但它似乎已经被插件使用了。

关于html - 使用 css 定位与其他东西具有相同类的东西,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57662075/

相关文章:

html - 文本不会在按钮内中断

html - CSS 悬停图像

javascript - 出现滚动条时防止屏幕闪烁

css - 如何在 Angular2 应用程序中创建粘性页脚?

css - 如何将此基于表格的布局转换为使用语义 html 和基于 css 的布局?

javascript - Chrome 扩展违反谷歌安全政策

php - 通过 php 在 html 元素的属性中打印特殊字符

javascript - 使用 : Need Javascript code that gets the inner width/height of screen onload into width/height style variables

javascript - React 15 - 查找元素的 offsetTop 属性

HTML 创建具有样式的 <a href...>