Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Why isn't this slideshow centered.

Posted on 2014-02-17
4
Medium Priority
?
231 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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 2000 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

Enroll in September's Course of the Month

This month’s featured course covers 16 hours of training in installation, management, and deployment of VMware vSphere virtualization environments. It's free for Premium Members, Team Accounts, and Qualified Experts!

Question has a verified solution.

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

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.
This article describes how to create custom column layout styles for Bootstrap. The article uses 5 columns to illustrate the concept, but the principle can be extended to any number of columns.
In this tutorial viewers will learn how add a scalable full-width header using CSS3. Create a new HTML document with an internal stylesheet. Set a tiled background.:  Create a new div and name it Header. Position it with position:absolute at the top…
In this Micro Tutorial viewers will learn how to create a CSS image sprite (In a later tutorial, viewers will learn how to use CSS and HTML to create a navigation menu using this sprite) Open a new Photoshop document with a width of (Icon width)x(N…
Suggested Courses

688 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