Why isn't this slideshow centered.

Posted on 2014-02-17
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


Question by:Rowby Goren
  • 2
  • 2

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.

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.


Accepted Solution

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%.

Author Closing Comment

by:Rowby Goren
ID: 39866084

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


Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
Css issue on scroll 1 38
Glitch when viewing from computer to mini-window(smartphone) 1 43
iOS 10 iPad Zoom and acroll 4 51
Error on link 14 36
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 …
Browsers only know CSS so your awesome SASS code needs to be translated into normal CSS. Here I'll try to explain what you should aim for in order to take full advantage of SASS.
In this tutorial viewers will learn how to customize the background color and font color of highlighted text using the ::selection element in CSS Begin by defining the selected text as an element in CSS by typing "::selection": Style the ::selection…
In this tutorial viewers will learn how to embed custom externally-hosted Google Fonts using the Google Font API in CSS Go to the Google Fonts website at Browse or search based on font properties or name to find a suitable font for…

919 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

16 Experts available now in Live!

Get 1:1 Help Now