I'm trying to understand inline and block level elements fully.
Can someone please explain the below behavior?
p {
border: 1px solid black;
}
span {
border: 1px solid red;
}
<body>
<span>
<p>hello</p>
</span>
</body>
Why is the p element overflowing the span?
to my understating block-level elements take the full width of their container.
the container of the p element is the span
.
but the p element is taking the full width of the screen.
why is causing this behavior?
element overflow the span element?
– Liam Anderson Oct 30 '22 at 16:17` element.
– Rob Oct 30 '22 at 16:43