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 CSS Selectors Selectors - Beyond the Basics DRY CSS

Emmanuel Rojas
Emmanuel Rojas
6,994 Points

Hi! what about if I want to use the inline-block for my buttons submit and reset, but I want to move them to the center.

Hi! what about if I want to use the inline-block for my buttons submit and reset, but I want to move them to the center. I do not get a way to do it. Thank you!

4 Answers

Gianmarco Mazzoran
Gianmarco Mazzoran
22,076 Points

Hi Emmanuel,

since I don't know how your code is I post here some html and the css for centering two or more buttons.

index.html
<div class="button-group">
    <button>SUBMIT</button>
    <button>RESET</button>
</div>
style.css
.button-group {
  text-align: center; /* that's all! */
}

Gianmarco is right. But if that does not work try using "clear: both;" to clear any other div's tho the right or left.

Gianmarco is right. But if that does not work try using "clear: both;" to clear any other div's tho the right or left.

Emmanuel Rojas
Emmanuel Rojas
6,994 Points

thank you very much guys. It helped a lot