-1

I have the below html:

<BODY>
   Hello:
   <br>
   <button>Hi</button>
   <button>Hey</button>
   <button>Bye</button>
   <hr>
</BODY>

I'm trying to make them appear in the centre of the body by placing them inside <div> but it didn't work. Any thoughts?

Tak
  • 3,536
  • 11
  • 51
  • 93

1 Answers1

2

This should work:

<BODY>
  Hello:
   <br>
   <div style="text-align:center;">
   <button>Hi</button>
   <button>Hey</button>
   <button>Bye</button>
   </div>
</BODY>

If you want it to be centered in the y axis, you can also insert vertical-align:middle next to text-align:center;.

D. Pardal
  • 6,173
  • 1
  • 17
  • 37