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,052 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