Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Rajinder Sihota
3,473 Pointsslider not centered in browsers
As you can see when you widen your browser, everything on the page is centered except the slider/galleria which is to the far left, how do I center this?
This is my code for my css:
.coin-slider { overflow: hidden; zoom: 1; position: relative; }
.coin-slider a{ text-decoration: none; outline: none; border: none; }
.cs-buttons { font-size: 0px; padding: 10px; float: left; }
.cs-buttons a { margin-left: 5px; height: 10px; width: 10px; float: left; border: 1px solid #B8C4CF; color: #B8C4CF; text-indent: -1000px; }
.cs-active { background-color: #B8C4CF; color: #FFFFFF; }
.cs-title { width: 545px; padding: 10px; background- color: #000000; color: #FFFFFF; }
.cs-prev,
.cs-next { background-color: #000000; color: #FFFFFF; padding: 0px 10px; }
3 Answers
J A
6,092 PointsTry giving the slider a margin of auto
Rajinder Sihota
3,473 PointsI tried:
.coin-slider { margin: auto; }
Didn't seem to do anything
J A
6,092 PointsShould be #coin-slider since it's an ID
myackley35
34,574 PointsApply the "margin: auto" to the div with the id of "coin-slider" and you should be good to go!
Rajinder Sihota
3,473 PointsOK thanks guys, there seemed to be a problem with reloading the page but it worked.!