Is it possible to style anonymous flex items explicitly?

前端 未结 4 2114
时光说笑
时光说笑 2020-12-11 23:07

I\'m in the early stages of grasping the basic flexbox concepts. The Using CSS Flexible Boxes article at MDN states (emphasis mine):

Each child of a f

4条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-11 23:18

    Obviously not, since otherwise all text in the following example would have to be styled like the word "just":

    p,
    em {
      margin: 1em;
      padding: 1em;
    }
    
    p {
      border: 1px solid blue;
      display: flex;
      justify-content: space-between;
    }
    
    em {
      border: 1px solid orange;
      display: inline-flex;
    }
    
    p * {
      color: green;
      font-size: 2em;
    }

    This is a just a test.

提交回复
热议问题