Why inline element span
without any content can display normally with width
and height
settings after adding position
property with the value absolute
?
Course link: workshop-ferris-wheel-step-7
Why inline element span
without any content can display normally with width
and height
settings after adding position
property with the value absolute
?
Course link: workshop-ferris-wheel-step-7
can you explain what do you mean with “normally”?
inline element without any content can display normally
I miss “with out any content” condition.
Or you can understand like “display like block”
I do not understand what you are asking, no
If we have an inline elemnt without any content,then we set width
and height
properties to it,it does not work right?
Because the size of inline elemnt is determined by its inner content.
But why,after adding position:absolute
to an inline element,even if there is nothing inside the inline element,setting width
and height
properties to it actually worked?
It makes inline element behave like when doing the same thing to block and inline-block element.
Sorry for bad descrption of my question…
position: absolute
is not compatible with inline elements, so it becomes a block element
Is there any reason behind this
or just consider it as a rule?
it’s how it is implemented, for a reason maybe you could research the implementation specs
OK I got it!!! Thanks!