Reputation: 34217
:after
selector?CSS
div{
background:#59c;
box-sizing: border-box;
height: 100px;
width: 100%;
position: relative;
}
div:after{
background:#b55;
content: "I SHOULD BE AFTER CONTENT BOX";
width: 100%;
display:block;
}
Upvotes: 0
Views: 519
Reputation: 103790
You can use absolute positioning for the pseudo element :
div:after{
position:absolute; /* <-- add this */
top:100%; /* <-- and this */
background:#b55;
content: "I SHOULD BE AFTER CONTENT BOX";
width: 100%;
display:block;
}
Upvotes: 3
Reputation: 7900
This will work as you expect :
div {
background:#59c;
box-sizing: border-box;
height: 100px;
width: 100%;
position: relative;
}
div:after {
position: absolute;
top: 100%;
left: 0;
background: #b55;
content: "I SHOULD BE AFTER CONTENT BOX";
width: 100%;
display: block;
}
Upvotes: 1