background image

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,
 
T

Trevor Lawrence

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">
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top