首页
学习
活动
专区
圈层
工具
发布
首页
学习
活动
专区
圈层
工具
MCP广场
社区首页 >问答首页 >如何用querySelectorAll覆盖querySelector中的标头?

如何用querySelectorAll覆盖querySelector中的标头?
EN

Stack Overflow用户
提问于 2022-04-04 03:29:55
回答 1查看 306关注 0票数 0

我使用的是datepicker-dialog.css,我有一个querySelectorAll,它在(.datepicker)中检索头部。但是,.datepicker有一个标题,它使用display:flex;它垂直地而不是水平地打破显示天数的日历。

内部数据采集器-dialog.css

代码语言:javascript
运行
复制
.datepicker-dialog .header {
  cursor: default;
  background-color: white;
  padding: 7px;
  font-weight: bold;
  text-transform: uppercase;
  color: black;
  display: flex;
  justify-content: space-around;
}

在我的index.html里

代码语言:javascript
运行
复制
<script>
    // Initialize the Datepicker-Dialog objects
    document.querySelectorAll('.datepicker').forEach(function (dp) { new DatePickerDialog(dp); });
</script>

我不想直接更改这个类,因为它正在其他地方使用,所以我尝试在datepicker-dialog.css中添加一个新类并调用querySelector。

代码语言:javascript
运行
复制
<script>
    // Initialize the Datepicker-Dialog objects
    document.querySelectorAll('.datepicker').forEach(function (dp) { new DatePickerDialog(dp); });
    document.querySelector('.datepicker-dialog-mismatch');
</script>

希望它可以覆盖selectorAll,但是没有什么改变。我接着又说

代码语言:javascript
运行
复制
<style>
    .datepicker-dialog-mismatch .header {
        cursor: default;
        background-color: white;
        padding: 7px;
        font-weight: bold;
        text-transform: uppercase;
        color: black;
        justify-content: space-around;
}
</style>

在我的html文件的顶部,但问题仍然存在。我还可以使用哪些其他选项/函数来覆盖标头?

EN

回答 1

Stack Overflow用户

发布于 2022-04-04 14:46:59

tablesorter函数与我的日历重叠,因此导致它显示错误。

代码语言:javascript
运行
复制
jQuery(document).ready(function() {
        jQuery("#view_table").tablesorter();
    });

一旦我把它注释掉,日历就像它应该水平显示的那样工作。

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/71731720

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档