CSS position:fixed

Hi everyone! I’m trying to apply “position:fixed” to my h1 in CSS so that the title stays on top of the page when I scroll down, but when i do it the title disappears… Not sure why. Could someone help me understand it?
I also tried wraping the h1 in a div and applying the style to the div

h1 {
text-align: center;
padding: 20px;
background-color: #FFFAF0;
font-family: papyrus;

try to add also width: 100% to the title,
and if you want it on the top
add this at the begin of your style:

  margin: 0;
  padding: 0;

to reset margin and padding to 0

1 Like

That worked! Thank you :grin:

1 Like

I’m glad, your welcome!

This topic was automatically closed 182 days after the last reply. New replies are no longer allowed.