how to insert a single full image as background for a web page | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

how to insert a single full image as background for a web page

11th Jul 2016, 5:03 PM
Sushanth S
Sushanth S - avatar
4 Answers
+ 1
<body background="image.png"> for HTML5 is better to use CSS since this attribute is no more compatible
11th Jul 2016, 5:27 PM
marco
+ 1
body { background: #fff url("img.jpg") no-repeat; }
11th Jul 2016, 11:43 PM
ZinC
ZinC - avatar
0
But how to align it. I mean only 1/3rd of picture is shown how can i make the full image to be displayed in the background.
15th Jul 2016, 7:34 PM
Sairam
Sairam - avatar
- 1
<style> body {background-image:url("xxx.png");} </style>
13th Jul 2016, 10:08 PM
M Nav Iwakura
M Nav Iwakura - avatar