html - background images outside of a container css -
im trying build web layout has fixed width container. design calls background images go outside of container though, meanwhile still keeping text of divs within container. below image show mean:
the black container, red sidebar. content on sidebar should stay within container, different sections of sidebar have different background colors.
any suggestions?
you can manage pseudo-elements
extract of relevant code demo.
aside .block:before { position: absolute; content: ''; left: 0; top:0; height: 100%; width: 100vw; background: rgba(0,255,0,0.5); z-index:-1; }
note: layout method here i've used not relevant. use flexbox
fun works other, older layout methods well.
Comments
Post a Comment