Yaroslav Kuzyo
Yaroslav Kuzyo

Reputation: 23

Centering slider in the window

Can't find solution for centering my slider. Here what I have http://codepen.io/Kuzyo/pen/vbhDF
cnt have width 100% because I want that my cnt-block go beyond window.
cnt-wrap has width 5200px for every cnt-blocks.
How can i center my slider in center and my cnt-blocks go beyond window. Sorry for my awfull explanation. Thanks for advice

Upvotes: 0

Views: 61

Answers (1)

relic
relic

Reputation: 1704

You don't need your .ctn element to have a width of 100% to accomidate the child. You want to set it to the width that your slider should occupy (maybe 960px or 1120px or whatever) and center that. Probably need to set overflow hidden as well. Your .cnt-block-wrap width of 5200px will accommodate the slides inside.

 .cnt {
  height: 100%;
  margin: 0 auto;
  overflow: hidden;
  width: 960px;
  position: relative;
 } 

Upvotes: 1

Related Questions