Non transparent div inside a transparent div

后端 未结 4 1237
梦毁少年i
梦毁少年i 2021-01-08 01:09

I am creating a webpage that have a transparent div.

I want to add a non-transparent div inside that transparent div and I find that it is also transparent.

4条回答
  •  Happy的楠姐
    2021-01-08 02:02

    use background, padding, background-origin to control the padding and z-index to control the position of the element. For example:

    #mydiv{ background: white; padding:100px; background-origin:border-box; z-index:1}
    

提交回复
热议问题