Nested CSS styles?

前端 未结 4 1031
情歌与酒
情歌与酒 2021-01-28 14:07

Is something like this possible?

.imgbox:hover{ .ui-resizable-se { /*some style */ } }

Or a conceptual equivalent? Basically, only when an elem

4条回答
  •  青春惊慌失措
    2021-01-28 15:07

    Not with plain CSS but you can with a CSS preprocessor like Sass:

    http://sass-lang.com/

    table.hl {
      margin: 2em 0;
      td.ln {
        text-align: right;
      }
    }
    
    li {
      font: {
        family: serif;
        weight: bold;
        size: 1.2em;
      }
    }
    

    Generates:

    /* CSS */
    
    table.hl {
      margin: 2em 0;
    }
    table.hl td.ln {
      text-align: right;
    }
    
    li {
      font-family: serif;
      font-weight: bold;
      font-size: 1.2em;
    }
    

提交回复
热议问题