Does anyone know how to but a background image on the margin in html | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

Does anyone know how to but a background image on the margin in html

I have created padding and a border and even left space for the margin but when i use the background image tag the whole body has that particular image so can anyone help me out

2nd Dec 2017, 10:33 PM
Sonicspeed^__^
Sonicspeed^__^ - avatar
2 Answers
+ 2
This might be a really bad way... but you could set the background image as you have done and then use a div tag which covers the main part of the body, this could be a block color so that is obscures the image behind it. e.g. <div class="main-body"> ... which should sit inside <body>, not including the margins
3rd Dec 2017, 1:24 AM
Dan Walker
Dan Walker - avatar
- 1
thanks bro
3rd Dec 2017, 5:45 AM
Sonicspeed^__^
Sonicspeed^__^ - avatar