CSS CSS Selectors Selectors - Beyond the Basics DRY CSS

I want to center the buttons

I would like to center the buttons for SUBMIT and RESET. How can I do it? Guil in the video for DRY he did this @media (min-width: 769px) { .inln { width: auto; display: inline-block; } } but I would like to center them. I need help.

3 Answers

Bogdan Cabaj
Bogdan Cabaj
16,118 Points

Hi Oscar,

In order to center both buttons you will have to wrap both buttons in a div.

.center {
 text-align: center;
}

I gave my div a class of center and added center class selector to my css.

      <div class="center">
        <input class="btn default inln" type="submit" value="Submit">
        <input class="btn inln error" type="reset" value="Reset"> 
      </div>
'''

I hope this is what you wanted.

text-align: center;

Thanks Bogdan it worked.