CSS Master

(Primo) #1
#f, #g {
position: absolute;
}
#f {
background: rgba(255,193,7,.9);
}
#f p {
background: rgb(34,34,34);
color: whitesmoke;
position: relative;
z-index: 1;
}
#g {
background: rgba(3,169,244,.7);
top: 50px;
left: 100px;
}

Accordingtotherulesofthestackingcontext,#f poccupiesthetop-mostlayerin
thestack.That’swhatweseeinFigure4.8.

Figure 4.8. The rendered version of our sample HTML and CSS

ButifwechangeourCSSandaddopacity: .99tothe#fruleset,somethinginter-
estinghappens:

140 CSS Master

Free download pdf