Answer the question
In order to leave comments, you need to log in
Why can an input element be given a width and height if it's inline?
Hello,
I'm learning the basics of HTML and CSS and ran into an incomprehensible situation. As far as I understand, it is impossible to set height and width to
elements with property .
But, for some reason, an element that seems to be inline by default (following from this list: https://developer.mozilla.org/en-US/docs/Web/HTML/... ) can be given a width and height (as opposed to another inline element ).
Even if I explicitly set the property in CSS , I can still specify the width and height: https://codepen.io/jurako91/pen/wvJLLVK
Why is that? display: inline
input
span
display: inline
Answer the question
In order to leave comments, you need to log in
By default, INPUT has the property
input {
display: inline-block;
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question