J
J
jurako2021-06-24 11:57:05
css
jurako, 2021-06-24 11:57:05

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

inputspan

display: inline


Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
Sergey delphinpro, 2021-06-24
@jurako

By default, INPUT has the property

input {
  display: inline-block;
}

Be careful.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question