Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

CSS

Button Centering Issue

Hi, So I got a school project for making a Dichotomous Key, and I decided to make my project into a website instead of printing it out on paper. I have 4 pages, a picture page with all the pictures for the key on, a page for the actual key, a page for the answers not yet revealed, and a button that links that to the fourth page which has the answers revealed and vice versa. I can't seem to figure out how to center that button so it looks cleaner.

<a href="real_answer.html"><button id="button">Show</button></a>
/* Button Styling */
#button {
  background-color: #6ab47b;
  -moz-border-radius: 15px;
  -webkit-border-radius: 15px;
  border: 5px solid #599a68;
  padding: 5px;
}

/* Button Font */
#button {
  font-family: 'Changa One', sans-serif;
  margin : 3px 0;
  font-size: 1em;
  font-weight: normal;
  line-height: 0.8em;
  color: #fff;
}

Thanks!

try

margin: 0 auto;

or

text-align:center;

1 Answer

P.S. I am following along and modifying the page of the "How to Make a Website" course.