div { width: 100px; height: 100px; background: red; } div:before { content: ""; width: 100px; height:30px; background: yellow; } Why isn't the before pseudo element showed above the div element when the position values (relative and absolute respectively) are not set?