html - Center text and button elements within Orbit slider? -
i having hardest time figuring out how make 2 text elements , button centered within orbit slider in foundation. apologize such beginner question, brand new foundation , of syntax confusing me.
it slider 4 images, , i'm trying superimpose centered h3, p , button elements on top. pulled left.
html:
<div class="row columns"> <div class="orbit" id="featured" role="region" aria-label="favorite space pictures" data-orbit> <ul class="orbit-container" data-caption="#captionone"> <button class="orbit-previous" aria-label="previous"><span class="show-for-sr">previous slide</span>◀</button> <button class="orbit-next" aria-label="next"><span class="show-for-sr">next slide</span>▶</button> <li class="orbit-slide is-active"> <img src="images/manuchelseaalt.jpg"> <h3 class="blogtitle">manchester united v. chelsea</h3> <p>my in-depth discovery on 2 of popular teams</p> <a href="#" class="alert button">read more</a> </li> <li class="orbit-slide"> <img src="images/bestplayers.jpg"> <h3 class="blogtitle">the best players in fĂștbol</h3> <p>i learn makes these special players unique.</p> <a href="#" class="alert button">read more</a> </li> <li class="orbit-slide"> <img src="images/worldcup.jpg"> <h3 class="blogtitle">the world cup</h3> <p>i figure out why most-watched event in world.</p> <a href="#" class="alert button">read more</a> </li> <li class="orbit-slide"> <img src="images/manustadium.jpg"> <h3 class="blogtitle">the basics of fĂștbol</h3> <p>i learn basics.</p> <a href="#" class="alert button">read more</a> </li> </ul> </div> </div>
css:
#featured h3, #featured p, #featured .button { position: absolute; color: white; } #featured h3 { top: 35%; margin-left: 10%; } #featured p { top: 50%; margin-left: 10%; } #featured .button { top: 65%; margin-left: 10%; } .blogtitle { font-family: 'cormorant sc', serif; font-size: 3em; color: white; }
change:
#featured h3, #featured p, #featured .button { position: absolute; color: white; }
to:
#featured h3, #featured p, #featured .button { position: absolute; left: 50%; transform: translatex(-50%); color: white; }
Comments
Post a Comment