background image

  • Thread starter Thread starter Mark
  • Start date Start date
M

Mark

I would like to create a background image/background that does not move
when you scroll through the web page. I guess you need to use css for that
but I'm not sure how. Any help would be appreciated.

Thanks,
 
Yes, you need CSS but not much

body { background: url(images/mypic.jpg) fixed repeat top left; }

The parameters are
repeat: causes small images to be repeated
fixed: does nor scroll
top left: places image at top left (or starting at top left when the image
repeats)

This can be put in the head section e.g
<html>
<head>
.........
<style type="text/css">
body { background: url(images/mypic.jpg) fixed repeat top left; }
</style>
....
<head>
<body>
.....

Alternatively, you can put the CSS in a separate file,.say "style.css". This
is then referred to in the <head> section as follows
<link rel="stylesheet" type="text/css" href="style.css">
 
Back
Top