我想将 padding-left 更改为 769px 和 1340px 之间的 24px,但我当前的媒体查询不起作用。寻求解决这个问题。
@media(min-width:1340px){
.target-side-col li{
padding-left:60px;
}
}
@media(min-width:769px && max-width:1340px){
.target-side-col li{
padding-left:24px;
}
}
Run Code Online (Sandbox Code Playgroud) 尝试将子项移到父项之外,然后在vanilla JavaScript中删除父项本身.当前代码看起来像这样:
<div class="parent">
<div class="child"></div>
<div class="child"></div>
</div>
Run Code Online (Sandbox Code Playgroud)
期望的输出:
<div class="child"></div>
<div class="child"></div>
Run Code Online (Sandbox Code Playgroud) 我很好奇DRYest使用某个类抓取A标签的方法是A标签是否埋在元素的innerHTML中.如果需要知道,innerHTML包含各种div和其他A标签.以下是我所说的一个例子:
var content = something[0].innerHTML;
// I would want to see whether an A tag with say a certain class "button" exists within "content" then store that A tag in another variable.
Run Code Online (Sandbox Code Playgroud)