CSS newbie question on display property | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

CSS newbie question on display property

Hello. I'd be greatful if someone could help me understand what this means. "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." I assumed this meant I couldn't put a block eleemnt like <div> inside of an inline one like <span> if that span had display:block set. But I can do this just fine and it doesn't seem to make any difference. A screenshot of my code https://prnt.sc/msntl3

3rd Mar 2019, 5:38 PM
Callum Evans
Callum Evans - avatar
2 Answers
+ 1
//Yes is doses'nt seems to makes difference but the universal css rule is that
3rd Mar 2019, 5:54 PM
Sudarshan Rai
Sudarshan Rai - avatar
0
@Shudarshan Rai Just best practice not to then? Gotcha. Thanks
3rd Mar 2019, 5:55 PM
Callum Evans
Callum Evans - avatar