viewport height, whilst centralising the image within slider css -
i have slider on homepage working on. trying achieve full viewport height takes whole width screen.
the way can achieve either stretching image, or image isn't centred.
the image needs aligned centred horizontally , vertically, customers can see centre of image on width of browser, , without stretching image out of proportion.
i have tried background-size: cover; on element no success not background img. containers have 100vh currently, width issue.
the issue located here http://joeybox.info/ . realise menu , logo above image 100 viewport height rest under "fold", placing logo , menu on image eventually, once have figured out css.
i have tried many solutions found within stack overflow forum , none work in scenario.
my current css, after deleting in-correct code, is:-
.bx-wrapper img {display: inherit; height: 100vh; max-width: inherit;} .ewic-wid-imgs {height: 100vh; max-width: unset; width: unset;} .bx-wrapper img {display: inherit; height: 100vh; max-width: inherit;}
html=
<div class="slider-box"> <div id="ewic-con-385"> <div style="display: none;" id="preloader-385" class="sliderpreloader"> </div> <div style="max-width: 100%; margin: 0px auto;" class="bx-wrapper"> <div style="width: 100%; overflow: hidden; position: relative; height: 633px;" class="bx-viewport"> <ul style="width: 315%; position: relative; left: 0px;" class="bxslider-385"> <li style="float: left; list-style: outside none none; position: relative; width: 1349px; margin-right: 10px;" class="ewic-slider bx-clone"> <img title="qw direct leather keyrings" class="ewic-wid-imgs" src="http://joeybox.info/wp-content/uploads/2015/07/qw-direct-leather-keyrings.jpg"> <div class="ewic-caption"><span>qw direct leather keyrings</span></div> </li><li style="float: left; list-style: outside none none; position: relative; width: 1349px; margin-right: 10px;" class="ewic-slider"> <img title="qw direct leather keyrings" class="ewic-wid-imgs" src="http://joeybox.info/wp-content/uploads/2015/07/qw-direct-leather-keyrings.jpg"> <div class="ewic-caption"><span>qw direct leather keyrings</span> </div></li><li style="float: left; list-style: outside none none; position: relative; width: 1349px; margin-right: 10px;" class="ewic-slider bx-clone"> <img title="qw direct leather keyrings" class="ewic-wid-imgs" src="http://joeybox.info/wp-content/uploads/2015/07/qw-direct-leather-keyrings.jpg"><div class="ewic-caption"> <span>qw direct leather keyrings</span> </div></li></ul></div> <div class="bx-controls bx-has-controls-direction bx-has-controls-auto"> <div class="bx-controls-direction"><a class="bx-prev disabled" href="">prev</a> <a class="bx-next disabled" href="">next</a></div><div class="bx-controls-auto"><div class="bx-controls-auto-item"><a class="bx-start active" href="">start</a></div> <div class="bx-controls-auto-item"><a class="bx-stop" href="">stop</a></div></div></div></div><br> </div> </div>
to achieve add image inside .bx-wraper:
.bx-wrapper img { display: inherit; position:absolute; left:0; right:0; top:0; bottom:0; margin:auto; max-width: inherit; }
now need set parent li
relative:
.bx-wrapper ul li { position:relative; width:100%; height:100%; list-style: none !important; margin: 0 !important; }
and change parent ul:
.bx-wrapper ul{ width:100%; }
Comments
Post a Comment