I’ve been trying to center my h2 with the background-image
h2
background-image
I was trying to use:
h1::before { background-image: url(star.png); } h1::after { background-image: url(star.png); }
But this doesn’t work.
Do I need to use a special display property?
display
Hello @salvadorperezm
for h1::before and h1::after it mean it will add what inside the selector before or after the h1 and even to see that work you would need to add content even it just simple space
h1::before
h1::after
could you share your full code and link to the task
and have a nice day
Sure, here’s my code and here’s the task.
use text-align:center; aand it will center it and check this for extra details about what text-align can do https://developer.mozilla.org/en-US/docs/Web/CSS/text-align
text-align:center;
hope that help and have a nice day
It did! Thank you
you welcome