-1

I have an JPG image with size 1024 x 724. My page size is not fixed. My requirement is: If I resize the page then the background image should also resize and fit to the page.

Hysteria
  • 9
  • 3

2 Answers2

0

You should do this with backgroud-size in css

If you'd like to use CSS3, you can do it pretty simply using background-size, like so:

background-size: 100%;

in you div you can add the style directly without using a css external file

<div style ="background-size: 100%;" ....> .... </div>
ScaisEdge
  • 131,976
  • 10
  • 91
  • 107
  • i know it but i just want to know if there any other way using html ? like body backgroung="png.png" height="100%" width ="100%" – Hysteria Jul 16 '16 at 08:21
0

You need to make a 100% width b aground which must cover up you complete background. So please add this css in you style.css file.

html {
  background: url(yourimage.jpg);
  background-size:cover;
  }