Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the default display property of a button in HTML?

Tags:

html

css

If no display style is specified, what is it by default for a <button> element? Is it block or inline-block?

My Chrome is ambiguous. It says block and then inline-block so which one is it?

enter image description here

I'm almost certain it is inline-block, but I'd like to be sure. I couldn't find anything about it in the documentation

like image 321
Arthur Tarasov Avatar asked Aug 24 '18 04:08

Arthur Tarasov


1 Answers

Inline block. See the behavior of the button in this snippet in Chrome.

Is the button next to me? <button>Yes</button> Must be inline-block then...
like image 132
JasonB Avatar answered Oct 21 '22 02:10

JasonB