Answer the question
In order to leave comments, you need to log in
Why is the pseudo element smaller than the parent?
Good afternoon. Can you please tell me why the pseudo-element is smaller than the parent?
Above is a span and below is a pseudo element Span
Styles:
.header__burger-btn span {
width: 100%;
height: 1px;
border: 2px solid #202020;
position: absolute;
}
Pseudo element style:
.header__burger-btn span::before {
content: "";
position: absolute;
width: 100%
height: 100%;
top: 10px;
border: 2px solid #202020;
}
Answer the question
In order to leave comments, you need to log in
because in width width: 100%; the pseudo-element does not have a parent border
The pseudo-element is inside the parent. And occupies 100% of its internal width .
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question