Search code examples
htmlcssbuttonposition

How do I position the text in a button?


Suppose I have a button:

HTML

<input type="button" class = "button" value="Click here"

CSS

.button {
  height: 300px;
  width: 300px;

This button is going to be big and I dont want to position the text in the center, I want to position it in the center top. how do I do it?


Solution

  • You can use text-align with line-height based on the height you give to the button