How to scale a div without scaling content

前端 未结 3 2005
谎友^
谎友^ 2020-12-20 23:39

I have this div (id=\"myDiv\"), when the div is under css - scale all it\'s children are under scale as well. I need the div to enlarge but not the children, in a \"creative

3条回答
  •  悲哀的现实
    2020-12-21 00:31

    If you scale to 0, your content will hide and if you scale to negatie value, it will flip. Child elements will always inherit scale from its parent so setting scale for children to 1 wont help either.

    If possible, I recommend you not to use scale, but try to adjust your parent size manualy. Otherwise you can try to scale your parent div, but position your children absolutely within it (being in the same container with parent myDiv)

提交回复
热议问题