Why i can't nest <ul> element inside the <p> element whereas we can nest <ul> element inside the <div> element? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Why i can't nest <ul> element inside the <p> element whereas we can nest <ul> element inside the <div> element?

As we know, both <p> & <div> and <ul> elements are block level elements. but why we can nest <ul> in <div> and can't in <p>?

24th Jun 2021, 8:02 AM
Kiran Chaudhary
Kiran Chaudhary - avatar
1 Answer
+ 1
It seems you can nest them. Or do you mean something else? https://code.sololearn.com/WJ5172DsZliS/?ref=app edit: ul style is not applied in p > ul
24th Jun 2021, 10:49 AM
Lisa
Lisa - avatar