html - Responsive Images using CSS background image -
i trying figure out best way approach creating responsive image fit whole background of div container. there 2 text boxes have rbga value need inline part of image.
i wondering if better z index , put image in html or keep image in css background image?
right now, rest of images using javascript, jquery , php resize images located in html. using media queries adjust page. trying not 3 images; maybe best option?
here have far. have removed code not add confusion. attached jpg of trying accomplish. can paragraph divs line up; not responsively match image.
<section id="content" role="main" class="cf"> <div class="mission"> <h1>we create</h1> <p>lorem ipsum dolor sit amet, consectetur adipiscing elit. donec libero odio, gravida sedconsequat a, faucibus dignissim</p> </div> </section> css .mission { background-image:url(../images/gallery_banner.jpg); background-repeat:no-repeat; background-size:contain; background-position:center; } .mission p { color: #fff; text-align:center; text-shadow: 2px 1px 1px #4c4341; background: rgba(81,118,131, .9); width: 100%; margin: 0 auto; margin-top: 220px; margin-bottom:5%; } .mission h1 { font-weight: bold; font-size: 120%; color: #fff; text-shadow: 2px 1px 1px #4c4341; background: rgba(81,118,131, .9); letter-spacing:.1em; text-align: center; }
link photoshoped image of trying do:
https://docs.google.com/file/d/0b_tamxxa2n8ouxj2lvd0sfzwqvk/edit?usp=sharing
i put image html , style css fit container.
<div id="container"><img src="http://i35.tinypic.com/69kdw8.jpg" border="0" alt="image , video hosting tinypic"><div id="d1">test</div><div id="d2">test test2</div></div>
and style it:
#container { position:relative; } #d1, #d2 { position:absolute; background-color:green; opacity:0.7; color:white; } #d1 { height:16%; width:39%; bottom:0; left:0; } #d2 { height:68%; width:29%; top:0; left:58%; }
Comments
Post a Comment