【问题标题】:How to ignore jQuery mobile styling?如何忽略 jQuery 移动样式?
【发布时间】:2017-09-25 18:48:53
【问题描述】:

我有一个动态创建的标签元素。当我创建它时,我给它一个值为“none”的数据滚动属性,并试图用我自己的具有“!important”值的类来覆盖它。不幸的是,保证金仍在执行中。

这是控制台的图像:https://gyazo.com/26566879cb903304a24b3b313a777c75

CSS:

#label {
    margin: 0px !important;
}

JS:

$("<label />") //create new label
            .attr("id", "label" + listCount) //set ID
            .attr("for", "input" + listCount) //set For
            .attr("class", "inline")
            .attr("data-roll", "none")
            .html(input) //set contents
            .appendTo("#input" + listCount + "container");//add to checkbox container

【问题讨论】:

    标签: javascript jquery css jquery-mobile


    【解决方案1】:

    试试:

    label.inline {
        margin: 0px !important;
    }
    

    因为您的id 实际上将是#labelSOMEnUMBER,所以您不能用您的id 选择它。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2010-10-31
      • 1970-01-01
      • 1970-01-01
      • 2012-12-05
      • 1970-01-01
      • 2012-07-09
      • 2021-09-08
      相关资源
      最近更新 更多