Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Make a background image static?

Tags:

html

So, I'm trying to make the background image static, and have the foreground content move over it. Having some issues, what am I doing wrong? Here is my current code.

body
{
color: #000;
margin: 10px 0px 10px 0px; 
background-color: #ffffff;
background-image:url('http://userlogos.org/files/backgrounds/Mafia_Penguin/Map1280x800.jpg');
background-repeat:no-repeat;
font-family: Arial, Helvetica, sans-serif;
}
like image 618
Darren Avatar asked Dec 28 '22 07:12

Darren


1 Answers

You need to set the background-attachment property to fix the background image.

background-attachment: fixed;
like image 156
kennytm Avatar answered Jan 13 '23 11:01

kennytm