CSS/HTML - how to responsively center buttons on all devices

Hello,

How do we responsively center these category buttons on all devices?

It's the shop by category buttons on this page:  http://www.usamedicalgloves.com

<div id="shop-by-category-home">
  <div class="header-home-categories">Shop By Category</div></div>
<div class="buttons-home">
  <div class="category-home"><a href="http://www.usamedicalgloves.com/disposable-nitrile-gloves.html"><img src="/assets/images/nitrile-gloves.jpg" /></a></div>
  <div class="category-home"><a href="/latex-gloves"><img src="/assets/images/latex-gloves.jpg" /></a></div>
  <div class="category-home"><a href="/vinyl-gloves"><img src="/assets/images/vinyl-gloves.jpg" /></a></div>
  <div class="category-home"><a href="/medical-gloves"><img src="/assets/images/medical.jpg" /></a></div>
  <div class="category-home"><a href="/latex-free-gloves"><img src="/assets/images/latex-free.jpg" /></a></div>
  <div class="category-home"><a href="/powdered-gloves"><img src="/assets/images/powdered.jpg" /></a></div>
  <div class="category-home"><a href="http://www.usamedicalgloves.com/synthetic-gloves"><img src="/assets/images/synthetic.jpg" /></a></div>
  <div class="category-home"><a href="/sterile-gloves"><img src="/assets/images/sterile.jpg" /></a></div>
  <div class="category-home"><a href="/cheap-disposable-gloves"><img src="/assets/images/cheap.jpg" /></a></div>
  <div class="category-home"><a href="/lab-gloves"><img src="/assets/images/lab.jpg" /></a><a></a></div>
  <div class="category-home"><a href="/powderless-gloves"><img src="/assets/images/powderless.jpg" /></a></div>
  <div class="category-home"><a href="/food-gloves-latex-and-non-latex"><img src="/assets/images/food.jpg" /></a></div>
  <div class="category-home"><a href="/examination-gloves"><img src="/assets/images/exam.jpg" /></a></div>
  <div class="category-home"><a href="/small-disposable-gloves"><img src="/assets/images/xs.jpg" /></a></div>
  <div class="category-home"><a href="/large-disposable-gloves"><img src="/assets/images/xxl.jpg" /></a></div></div>

Open in new window


#shop-by-category-home
{
width:100%;
text-align:center;
margin-top:-23px;
}

.header-home-categories
{
width:100%;
font-size:28px;
color:#747474;
text-align:center;
padding:15px 15px;
}

.category-home
{
float:left;
padding:15px 15px;
}

.category-home
{
float:left;
padding:13px 13px;
}

.buttons-home
{
text-align:center;
}

Open in new window

LVL 7
weikelbobAsked:
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

x
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

HainKurtSr. System AnalystCommented:
try this

http://jsfiddle.net/c2wqLn36/

.buttons-home {
  border: 1px solid red;
  text-align: center;
}

.category-home {
  width: 100px;
  height: 100px;
  //float: left;
  margin: 13px;
  border: 1px solid blue;
  display: inline-block;
}

Open in new window


ie: remove "float: left;" and use "display: inline-block;"
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
weikelbobAuthor Commented:
Couldn't get it to work:

www.usamedicalgloves.com

#shop-by-category-home
{
width:100%;
text-align:center;
margin-top:-23px;
}

.header-home-categories
{
width:100%;
font-size:28px;
color:#747474;
text-align:center;
padding:15px 15px;
}

.category-home {
  width: 178px;
  height: 178px;
  //float: left;
  margin: 13px;
  border: 1px solid blue;
  display: inline-block;
}

.category-home
{
float:left;
padding:13px 13px;
}

.buttons-home {
  border: 1px solid red;
  text-align: center;
}

Open in new window


<div class="fb-like" data-href="https://www.facebook.com/usamedicalgloves/" data-layout="button" data-action="like" data-size="small" data-show-faces="false" data-share="true">&nbsp;</div>
<div id="shop-by-category-home" style="text-align:center">
  <div class="header-home-categories">Shop By Category</div></div>
<div class="buttons-home" style="text-align:center">
  <div class="category-home"><a href="http://www.usamedicalgloves.com/disposable-nitrile-gloves.html"><img src="/assets/images/nitrile-gloves.jpg" /></a></div>
  <div class="category-home"><a href="/latex-gloves"><img src="/assets/images/latex-gloves.jpg" /></a></div>
  <div class="category-home"><a href="/vinyl-gloves"><img src="/assets/images/vinyl-gloves.jpg" /></a></div>
  <div class="category-home"><a href="/medical-gloves"><img src="/assets/images/medical.jpg" /></a></div>
  <div class="category-home"><a href="/latex-free-gloves"><img src="/assets/images/latex-free.jpg" /></a></div>
  <div class="category-home"><a href="/powdered-gloves"><img src="/assets/images/powdered.jpg" /></a></div>
  <div class="category-home"><a href="http://www.usamedicalgloves.com/synthetic-gloves"><img src="/assets/images/synthetic.jpg" /></a></div>
  <div class="category-home"><a href="/sterile-gloves"><img src="/assets/images/sterile.jpg" /></a></div>
  <div class="category-home"><a href="/cheap-disposable-gloves"><img src="/assets/images/cheap.jpg" /></a></div>
  <div class="category-home"><a href="/lab-gloves"><img src="/assets/images/lab.jpg" /></a><a></a></div>
  <div class="category-home"><a href="/powderless-gloves"><img src="/assets/images/powderless.jpg" /></a></div>
  <div class="category-home"><a href="/food-gloves-latex-and-non-latex"><img src="/assets/images/food.jpg" /></a></div>
  <div class="category-home"><a href="/examination-gloves"><img src="/assets/images/exam.jpg" /></a></div>
  <div class="category-home"><a href="/small-disposable-gloves"><img src="/assets/images/xs.jpg" /></a></div>
  <div class="category-home"><a href="/large-disposable-gloves"><img src="/assets/images/xxl.jpg" /></a></div></div>

Open in new window

0
ecarboneCommented:
try using "margin: 0 auto;"
0
Big Business Goals? Which KPIs Will Help You

The most successful MSPs rely on metrics – known as key performance indicators (KPIs) – for making informed decisions that help their businesses thrive, rather than just survive. This eBook provides an overview of the most important KPIs used by top MSPs.

weikelbobAuthor Commented:
No luck

#shop-by-category-home
{
width:100%;
text-align:center;
margin-top:-23px;
}

.header-home-categories
{
width:100%;
font-size:28px;
color:#747474;
text-align:center;
padding:15px 15px;
margin: 0 auto;
}

.category-home {
  width: 178px;
  height: 178px;
  //float: left;
  margin: 13px;
  border: 1px solid blue;
  display: inline-block;
}

.category-home
{
float:left;
padding:13px 13px;
margin: 0 auto;
}

.buttons-home {
  border: 1px solid red;
  text-align: center;
  margin: 0 auto;
}

Open in new window


<div id="shop-by-category-home" style="text-align:center;margin:0 auto">
  <div class="header-home-categories">Shop By Category</div></div>
<div class="buttons-home" style="text-align:center;margin:0 auto"">
  <div class="category-home"><a href="http://www.usamedicalgloves.com/disposable-nitrile-gloves.html"><img src="/assets/images/nitrile-gloves.jpg" /></a></div>
  <div class="category-home"><a href="/latex-gloves"><img src="/assets/images/latex-gloves.jpg" /></a></div>
  <div class="category-home"><a href="/vinyl-gloves"><img src="/assets/images/vinyl-gloves.jpg" /></a></div>
  <div class="category-home"><a href="/medical-gloves"><img src="/assets/images/medical.jpg" /></a></div>
  <div class="category-home"><a href="/latex-free-gloves"><img src="/assets/images/latex-free.jpg" /></a></div>
  <div class="category-home"><a href="/powdered-gloves"><img src="/assets/images/powdered.jpg" /></a></div>
  <div class="category-home"><a href="http://www.usamedicalgloves.com/synthetic-gloves"><img src="/assets/images/synthetic.jpg" /></a></div>
  <div class="category-home"><a href="/sterile-gloves"><img src="/assets/images/sterile.jpg" /></a></div>
  <div class="category-home"><a href="/cheap-disposable-gloves"><img src="/assets/images/cheap.jpg" /></a></div>
  <div class="category-home"><a href="/lab-gloves"><img src="/assets/images/lab.jpg" /></a><a></a></div>
  <div class="category-home"><a href="/powderless-gloves"><img src="/assets/images/powderless.jpg" /></a></div>
  <div class="category-home"><a href="/food-gloves-latex-and-non-latex"><img src="/assets/images/food.jpg" /></a></div>
  <div class="category-home"><a href="/examination-gloves"><img src="/assets/images/exam.jpg" /></a></div>
  <div class="category-home"><a href="/small-disposable-gloves"><img src="/assets/images/xs.jpg" /></a></div>
  <div class="category-home"><a href="/large-disposable-gloves"><img src="/assets/images/xxl.jpg" /></a></div></div>

Open in new window

0
HainKurtSr. System AnalystCommented:
put width margin and display inline-block

.category-home {
    /* float: left; */
    /* padding: 13px 13px; */
    display: inline-block;
    width: 150px;
    margin: 15px;
}

Open in new window


as I did in my first post, and you should be good...
0
weikelbobAuthor Commented:
Worked! Thanks!
0
weikelbobAuthor Commented:
Great work guys!
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
CSS

From novice to tech pro — start learning today.