Why Experts Exchange?

Experts Exchange always has the answer, or at the least points me in the correct direction! It is like having another employee that is extremely experienced.

Jim Murphy
Programmer at Smart IT Solutions

When asked, what has been your best career decision?

Deciding to stick with EE.

Mohamed Asif
Technical Department Head

Being involved with EE helped me to grow personally and professionally.

Carl Webster
CTP, Sr Infrastructure Consultant
Ask ANY Question

Connect with Certified Experts to gain insight and support on specific technology challenges including:

Troubleshooting
Research
Professional Opinions
Ask a Question
Did You Know?

We've partnered with two important charities to provide clean water and computer science education to those who need it most. READ MORE

troubleshooting Question

How do I center align a block element horizontally in CSS?

Avatar of Spiderstave
Spiderstave asked on
CSSHTML
9 Comments1 Solution557 ViewsLast Modified:
Hello,

I'm new to CSS layouts and I'm trying to build a simple color-picker. I have it created, but I can't get it to align in the center horizontally. I know this has something to do with it being a block element and text-align: center; not working, and I know that typically you use margin: auto; to align block elements, but no matter what I try it stays on the left. In the past I would have just put it in a table, but I'm trying to stop using tables for layout purposes ;) Any tips greatly appreciated.

Markup below.
ASKER CERTIFIED SOLUTION
Avatar of David S.
David S.Flag of United States of America imageConsultant & Challenge Subduer
Commented:
This problem has been solved!
Unlock 1 Answer and 9 Comments.
See Answers