How to place block element inside of an inline element with display:block css? | SoloLearn: Learn to code for FREE!

0

How to place block element inside of an inline element with display:block css?

Is there a way to place block elements inside of an inline element with display:block css?

1/26/2017 8:17:17 AM

Maxim Velichkin

4 Answers

New Answer

+1

You mean: <span style="display:block;"><div>some content</div></span> ? Yes, but it's strictly identiqual to: <div><div>some content</div></div> ... because with 'display:block;' you change the inline element in block element ^^ What is your goal more precisely? Show us the problematic code ;)

+1

Where did you read that? Still few minutes before, I was displaying some :P

0

display: inline-block;?

0

@vidph Yes, I thought so too, but I was confused after reading that "Setting the display property of an element only changes how the element is displayed, not what kind of element it is. So, an inline element with display:block is not allowed to have other block elements inside it."