Best way to size an element to the size of another element

后端 未结 2 1567
孤街浪徒
孤街浪徒 2021-01-23 17:46

I am using an old CSS trick to get a semi-transparent background for some content, without the content appearing semi-transparent. Here is the HMTL:

相关标签:
2条回答
  • 2021-01-23 17:56

    Try taking position: absolute off of the contentFrame but leaving it on the opacityFrame. That should cause it's parent to resize, and the opacityFrame to still overlay everything.

    0 讨论(0)
  • 2021-01-23 18:09

    do you have to use opacity? If it's a solid color, consider RGBA or if it's not solid, consider a semi-transparent PNG. That way you can nest them.

    0 讨论(0)
提交回复
热议问题