1. /* relationship selectors */
    2. /* 下一个满足条件的兄弟元素节点 */
    3. div + p{
    4. background: red;
    5. }
    6. /* 满足条件的所有兄弟元素节点 */
    7. div ~ p {
    8. background: black;
    9. }
    10. /* attribute selectors */
    11. /* 选择拥有独立属性名为a的元素 */
    12. div[data ~= 'a']{
    13. background: blue;
    14. }
    15. /* 选择属性名中以a开头或以a-开头的元素 */
    16. div[data |= 'a']{
    17. background: blueviolet;
    18. }
    19. /* 选择属性名以a开头的元素节点 $:以属性名结尾的元素节点 */
    20. div[data ^= 'a']{
    21. background: brown;
    22. }
    23. /* 选择属性名中含有a的元素节点 */
    24. div[data *= 'a']{
    25. background: cornflowerblue;
    26. }
    27. /* pseudo-element selectors */
    28. /* E:placeholder 输入框提示信息 只能这只字体颜色 */
    29. /* E::selection 字体选中, 只能设置字体颜色,背景颜色,阴影 */
    30. .che:checked + .text{
    31. background: green;
    32. }
    33. .che:checked + .text::after{
    34. content: "显示信息";
    35. color: #ffffff;
    36. }