background image



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.




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

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

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