Tell us what’s happening:
I am building a survey form. I am trying to put a background image on my webpage but the image gets stretched out and is unable to capture the entire image. I have tried using:
background-repeat:no-repeat;
background-size:cover;
background-position:center center;
background-attachment:fixed;
But it is not working. Help me, please?
Your code so far
<head>
<style>
h1#Title{
color:black;
text-align:center;
font-family: aerial;
font-weight: normal;
padding-top:50px;
margin-bottom:2px;
}
p#Description{
color:black;
text-align:center;
font-size:20px;
font-family: aerial;
}
body{
background-image:url("https://www.tripsavvy.com/thmb/CyXuQJWabjrBCRBCVmP4TbBAOmA=/950x0/filters:no_upscale():max_bytes(150000):strip_icc():format(webp)/sunrise-camping--676019412-5b873a5a46e0fb0050f2b7e0.jpg");
background-repeat:no-repeat;
background-size:cover;
background-position:center center;
background-attachment:fixed;
}
</style>
</head>
<h1 id="Title">freeCodeCamp SURVEY Form</h1>
<p id="Description"> Thankyou for taking the time to help us improve the platform.</p>
<body>
</body>
Your browser information:
Challenge: Build a Survey Form
Link to the challenge: