如何忽略 jQuery 移动样式?
How to ignore jQuery mobile styling?
我有一个动态创建的标签元素。当我创建它时,我给它一个值为 'none' 的数据滚动属性,并试图用我自己的 class 覆盖它,它具有 '!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
尝试:
label.inline {
margin: 0px !important;
}
因为你的 id
实际上是 #labelSOMEnUMBER
,你不能 select 它和你的 id
。
我有一个动态创建的标签元素。当我创建它时,我给它一个值为 'none' 的数据滚动属性,并试图用我自己的 class 覆盖它,它具有 '!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
尝试:
label.inline {
margin: 0px !important;
}
因为你的 id
实际上是 #labelSOMEnUMBER
,你不能 select 它和你的 id
。