CSS: how to select parent's sibling

This question already has an answer here:

  • Is there a CSS parent selector? 26 answers

  • You cannot do that with CSS but

    You can try using jQuery

    $("#showCheckbox").click(function(){
        $(this).parent().siblings().show();
    });
    

    You can't do it with CSS alone, you need to use javascript for this. As You need to catch the change event of the checkbox.

    链接地址: http://www.djcxy.com/p/22828.html

    上一篇: 选择单选按钮时更改单选按钮标签的颜色?

    下一篇: CSS:如何选择父母的兄弟姐妹