-6

I would Like to make my Background Image Responsive

.page {
     background-image: url("AA/NW.png");
     background-repeat: no-repeat;
     height: 650px;
     width: 1228px;
     position: relative;
    }

Would this solve it

    .page {
     background-image: url("AA/NW.png");
     background-repeat: no-repeat;
     height: auto;
     width: 100%;
     position: relative;
    }
slimderek
  • 43
  • 1
  • 1
  • 5
  • 5
    Possibly. Give it a go and see what happens. – Andy G Mar 13 '19 at 14:37
  • Possible duplicate of [Responsive css background images](https://stackoverflow.com/questions/12609110/responsive-css-background-images) – Stefan Neubert Mar 13 '19 at 14:38
  • have a look at [background-size](https://developer.mozilla.org/en-US/docs/Web/CSS/background-size) but it is expected you do some research before posting a question. [A simple search for background image responsive](https://www.google.com/search?q=background+image+responsive) finds a lot of things you can try. Please have a go and if you get stuck, then come back with your attempt and what didn't work – Pete Mar 13 '19 at 14:38
  • 1
    Also please take a [tour](https://stackoverflow.com/tour) of the [help centre](http://stackoverflow.com/help) to see [how to ask a good question](http://stackoverflow.com/help/how-to-ask) and what types of question are [on topic](http://stackoverflow.com/help/on-topic) for the site. If you continue to ask poor quality and downvoted questions, you will get a [question ban](https://stackoverflow.com/help/question-bans) – Pete Mar 13 '19 at 14:42

1 Answers1

0

You can use background-size property. The first value sets the width and the second value sets the height.

If you want it to be full-screen you can use it like this:

background-size: 100vw 100vh;
Faraz A.
  • 146
  • 1
  • 12