My image is streching

    <link rel="stylesheet" type="text/css" href="webpage1.css">
  <div class="top-1">
      <h1>my website</h1>

type or paste code here

body {
  margin: 0;    

h1 {
  text-align: center;
  padding: 180px 20px;;

.top-1 {
    background-image: url(images/download.jpeg);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: center;
    object-fit: cover;

Probably get rid of object-fit because that’s not how it works (it’s for applying to img/video etc elements).

But can you explain what you mean, because what you have works fine, no stretching at all. Are you sure the image is stretching, because the image in the screenshot you posted does not look like it’s stretched at all, it looks as I would expect it to look

1 Like

THANK YOU :grinning::grinning::grinning::grinning::grinning::grinning::grinning:

1 Like