Use duplicate class name on an element?

前端 未结 3 1827
[愿得一人]
[愿得一人] 2021-01-19 17:21

I found that there are many frameworks will check the duplicate class name before adding the new class name on the element that i think will slow down the performance.

3条回答
  •  旧时难觅i
    2021-01-19 18:19

    Semantic UI heavily uses attribute selectors

    like here

    .ui.grid [class*="left floated"].column {
      margin-right: auto;
    }
    .ui.grid [class*="right floated"].column {
      margin-left: auto;
    }
    

    If you want margin-left and margin-right to have the auto value, you must have a duplicate of the classname segment floated (ex.

    Lorem
    )

提交回复
热议问题