what is the order of outline strokes in html, css [duplicate]


يرجى شرح بإيجاز لمإذا تشعر أنك ينبغي الإبلاغ عن هذا السؤال.


Let’s say we have a div that has an outline and as inner html we have a span that has an outline as well. I would expect the outline of the inner span to go as foreground relative to the outline of the div, but that’s not true! we can see with the following code that the outline of the div is above the outline of the span. My question is why does this happen, and how can I make the outline of the span to go above the div’s one using css?

#background-div {
display: flex;
background-color: #555;
width: 100px;
height: 50px;
outline-style: solid;
outline-width: 4px;
outline-color: #999;
#foreground-span {
background-color: #fff;
width: 100px;
height: 25px;
outline-style: solid;
outline-width: 7px;
outline-color: #f00;
<div id=”background-div”>
<span id=”foreground-span”></span>
X 5 أشهر 2022-07-10T12:04:12+03:00 0 إجابة 2 مشاهدات مبتدئ 0

‫أضف إجابة


مجهول يجيب