So I am trying to position my pseudo element with position absolute, but instead, it is acting like its parent is something else.
<!DOCTYPE html>
<html>
<head>
<style>
p::after {
content: " - Remember this";
position: absolute;
top: 0;
}
</style>
</head>
<body>
<div style="position: absolute; top: 50px; left: 50px; border: 1px solid
black;">
<p>My name is Donald</p>
<p>I live in Ducksburg</p>
<p><b>Note:</b> For this selector to work in IE8, a DOCTYPE must be declared,
and you must use the old, single-colon CSS2 syntax (:after instead of
::after).</p>
</div>
</body>
</html>
i got that from w3school + some editing, because I needed to be sure it wasn't just my html that caused this.
what i want is for the pseudo elements to use the p tag as their parent and not the div
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…