javascript - Keep a list with img on a same line -


i know how place different li or div img inside centered on same line.

here picture of want have:

enter image description here

here did far:

as see li displayed vertically want display li horizontally.

what i've tried is: can if use position absolute li , display each 1 @ different % left:100% left first one, 200% second one,...

is solution? if want dynamically change image via javascript maybe it's more easy keep position:relative.

and here code.

html:

<div id="pagegallerie">    <div id="carre1" class="carre"></div>    <div id="carre2" class="carre"></div>    <div class="gallerie">       <li class="pictures" id="yo1"><img src="img/intro1.jpg" alt="smiley face"></li>       <li class="pictures"  id="yo2"><img src="img/intro2.jpg" alt="smiley face"></li>       <li class="pictures"  id="yo3"> <img src="img/intro3.jpg" alt="smiley face"></li>    </div> </div> 

and css :

#pagegallerie {     position: absolute;     width: 100%;     height: 100%; } .gallerie {     position: absolute;     width: 90%;     height: 85%;     top: 7.5%;     bottom: 7.5%;     left: 5%;     right: 5%;     text-align: center;     overflow: hidden; } li {     position: relative;     display: inline-block;     list-style: none;     width: 100%;     height: 100%;     text-align: center; } li img {     width: auto;     height: 100%; } #carre1 {     left: 2.5%;     background-image: url("../img/arrowb.png"); } #carre2 {     right: 2.5%;     background-image: url("../img/arrow.png"); } #carre1:hover, #carre2:hover {     background-color: rgba(0,0,0,0.2); } .carre {     width: 60px;     height: 76px;     position: absolute;     top: 50%;     margin-top: -38px;     box-sizing: border-box;     background-size: cover;     background-repeat: no-repeat;     z-index: 1000;     background-color: rgba(0, 0, 0, 0.02);     cursor: pointer; } 

here codepen made :

i have found these sliders you, in case if still need help.

you may clue creating own gallery, has multiple options sliders built jquery, sliders built out using jquery, slider arrow, slider without arrow, etc.., , lot more.

you can use library or can make own library making changes existing library if @ javascript.


Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

wso2esb - How to concatenate JSON array values in WSO2 ESB? -