Solved

Why isn't this slideshow centered.

Posted on 2014-02-17
4
212 Views
Last Modified: 2014-02-17
Me again :)

Why isn't this slideshow centered?

Link to test site
I have this css:
div#centeringwidgekits {
    width: 100% ;
  margin-left: auto ;
  margin-right: auto ;
  
}
       

Open in new window


Thanks!

Rowby
0
Comment
Question by:Rowby Goren
  • 2
  • 2
4 Comments
 
LVL 8

Expert Comment

by:Adrian Crabtree
ID: 39866016
Hi rowby,

The width is set to 100%, so there is no room for margins. If you change the width to 600px (this matches what the content's width is), you should see the slider center.
0
 
LVL 9

Author Comment

by:Rowby Goren
ID: 39866055
Hi Adrian,

Sounds good.  But will it work  in a responsive display if I declare 600px, for example?

However if I have no choice, that is what I'll do.  Fortunately it is a module so I can unpublish it for use on cell phones, for example.

Rowby
0
 
LVL 8

Accepted Solution

by:
Adrian Crabtree earned 500 total points
ID: 39866074
You can set it to a max-width of 600px. CSS would look something like this:

div#centeringwidgekits {
    width: 100%;
    margin-left: auto;
    margin-right: auto;
    max-width: 600px;
}

Open in new window


Setting a max-width will allow it to be responsive since the width is still declared at 100%.
0
 
LVL 9

Author Closing Comment

by:Rowby Goren
ID: 39866084
Thanks!

That did the trick!  and thanks for the info regarding max-width.

Rowby
0

Featured Post

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Suggested Solutions

Unordered lists (HTML ul tags) are very handy to create menus of all types, shapes and sizes.  All it takes is a little knowledge of CSS and the possibilities are endless. First off, you should know the general format for menus created using the …
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
In this tutorial viewers will learn how to define a gradient in CSS. Create a new HTML document with an internal stylesheet.: Create a div in CSS and name it Gradient. Define the background as "linear-gradient(to right, #ee3668, black)". Ensure you …
In this Micro Tutorial viewers will learn how to create navigation buttons that change on rollover, using CSS (Continuation of the CSS Image Sprite tutorial) Create a parent ID for all the list items       - Specify position: absolute and display: block…

708 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now