1

I know that elements with display: inline-block with display: value-other-than-visible (can) make the baseline of their parent position at the bottom of the inline-block's hpbm (height, padding, border, margin).

Why does text-area seem to produce the same effect? I know most user-agents make it inline-block.

For example:

textarea {
  height: 100px;
}
I am text.
<span>I am a span.</span>
<textarea></textarea>

div {
  display: inline-block;
  height: 100px;
}
I am text.
<span>I am a span.</span>
<div>I am an inline-block</div>
tonitone120
  • 1,920
  • 3
  • 8
  • 25
  • 2
    _The HTML specification doesn't define where the baseline of a – SeeoX Sep 25 '20 at 13:29
  • Please set----textarea {vertical-align:top;}-- The – Priya jain Sep 25 '20 at 13:38
  • Is the line-height of the `textarea` really the only thing that's responsible for changing the position of the line-height of the parent element? – tonitone120 Sep 25 '20 at 13:47
  • line-heights don't have a position. – Alohci Sep 25 '20 at 14:22
  • @Alohci Sorry meant to say: is the the baseline of the textarea really the only thing that's responsible for changing the position of the baseline of the parent element? – tonitone120 Sep 25 '20 at 15:18
  • The short answer is no. Its vertical-alignment will affect it too. But its kind of complicated. because they doesn't affect the baseline of the parent element directly. They affect the baseline of the line-box in which the textarea appears. The line box's baseline may or may not affect the baseline of the parent element. – Alohci Sep 25 '20 at 15:35

0 Answers0