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:

mockup

this markup:

<div id="header-bg">     <div id="header"></div> </div> <div id="site"></div> 

you can :after pseudo element , z-index property :

fiddle

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

Popular posts from this blog

apache - Remove .php and add trailing slash in url using htaccess not loading css -

javascript - jQuery show full size image on click -