Set width of fixed positioned div relative to his parent having max-width

后端 未结 3 1252
轻奢々
轻奢々 2021-01-02 01:24

Is there any solution without JS?

html

css

3条回答
  •  囚心锁ツ
    2021-01-02 01:28

    there is already a width on the column, just set the width of the fixed element to inherit. no reason to complicate things.

    CSS:

    .col-sm-3 { width: 25%; }
    .fixed-in-col { width: inherit; ... }
    

    HTML:

    ...

提交回复
热议问题