小编ink*_*ink的帖子

选择父级及其所有兄弟姐妹

我想选择一个父元素和它的兄弟姐妹.但是,选择.parent().siblings()不包括原始元素的父母.

$(this).parent().siblings().removeClass("active"); 
Run Code Online (Sandbox Code Playgroud)

我怎样才能选择父母的兄弟姐妹和父母呢?

javascript jquery parent

5
推荐指数
1
解决办法
126
查看次数

CSS媒体查询 - 订单事宜?

现在使用CSS媒体查询工作很多,我想知道最好使用它们的顺序.

方法1

@media only screen and (min-width: 800px) {
    #content { ... }
    #sidebar { ... }
}
@media only screen and (max-width: 799px) {
    #content { ... }
    #sidebar { ... }
}
Run Code Online (Sandbox Code Playgroud)

像这样显然代码更短,但是有了很多CSS,你最终会将一个容器的CSS扩展到样式表中的多个位置.


方法2

@media only screen and (min-width: 800px) {
    #content { ... }
}
@media only screen and (max-width: 799px) {
    #content { ... }        
}
@media only screen and (min-width: 800px) {
    #sidebar { ... }
}
@media only screen and (max-width: 799px) {
    #sidebar …
Run Code Online (Sandbox Code Playgroud)

css css3 media-queries

3
推荐指数
1
解决办法
3803
查看次数

标签 统计

css ×1

css3 ×1

javascript ×1

jquery ×1

media-queries ×1

parent ×1