-2

In the following code, why doesn't span adhere to the height rule:

<div style="border:1px black solid">
  inside div
  <span style="height:300px">inside span</span>
</div>

http://scratchpad.io/hilarious-shirt-8130

4thSpace
  • 43,672
  • 97
  • 296
  • 475

2 Answers2

1

You gotta put the next style to your span tag

display:inline-block;

If you wanna see the change put a background to your span

background-color: #f00;
0

Span is an inline element, which has neither a width nor height of its own. You would need <span style="height:300px; display:inline-block"> to get a styled height working.

See display:inline resets height and width

jla
  • 4,191
  • 3
  • 27
  • 44