The output on ':hover' is always
“1IPSUM”
If I decide to add a ':before' element with content 'content:"1"', it will just add a 1, making the output before hover to be "11"
The output I want is:
The output on 'hover' is "IPSUM"
Fiddle: https://jsfiddle.net/Zxdfvv/u9xgoks3/
.btn:hover:after { padding-bottom: 200px; content:"IPSUM"; }
<div class='btn'>1</div>
Thank you, EmSixTeen! I'm in school, so I can't log into my account. Do pseudo-elements work correctly on different browsers?
You are setting
content:
for the pseudo-element, not for the element itself. That's why when you add something to::before
it appears before the element text, and then if you use::after
it appears after the element text.You can use pseudo elements to set the initial text. So you can do this: