html - Different BG on different sides -
i want have different color on right of image , on left. right now, css looks this:
#header { width: 1000px; margin: 0 auto; height: 199px; background: url('img/header.jpg'); } #header-bg { width: 100%; background: #161b1c url('img/header-line.gif'); }
while #header-bg
actual background right , left (it contains line, irrelevant) , goes 100% of width. when change color #161b1c
, change both left , right side of header. differentiate between two. there other way apart doing of image?
i enclose mockup of site:
this markup:
<div id="header-bg"> <div id="header"></div> </div> <div id="site"></div>
you can :after
pseudo element , z-index
property :
css :
#header { width: 1000px; margin: 0 auto; height: 199px; background: url('http://lorempixel.com/output/nature-q-g-1000-239-1.jpg'); position:relaive; z-index:2; } #header-bg { width: 100%; background: #161b1c url('img/header-line.gif'); position:relative; z-index:1; } #header-bg:after{ content:""; position:absolute; right:0; top:0; width:50%; height:100%; background-color: gold; z-index:-1; }
Comments
Post a Comment