html - flood a div inside another div and set opacity -


say have html object tree follows:

<div>     <p>text 1</p>     <p>text 2</p>     <div></div> </div> 

i want css flood inner div inside of outer one. want text etc appear intact. idea can set bg color , opacity inner div , not affect text. how do this?

edit: emphasize on point: set opacity on outer div, text inside fade. don't want happen

you set outer div position: relative inner div to:

 position: absolute; top: 0; left: 0; width: 100%; height: 100%; 

and set whatever want on it. should cover inside first div. if want text appear on top of set:

 div p {    position: relative;    z-index: 1; }  div div {    z-index: 0; } 

Comments

Popular posts from this blog

c++ - Convert big endian to little endian when reading from a binary file -

C#: Application without a window or taskbar item (background app) that can still use Console.WriteLine() -

unicode - Are email addresses allowed to contain non-alphanumeric characters? -