| How do I stop page backgrounds from scrolling or repeating? |
| User Opinions |
|
No users have voted.
|
|
Thank you for rating this answer.
|
The old-fashioned way to set a page background image is to set the bgsrc attribute of the body element, like this: Body of page goes here
The trouble is that if the page goes on long enough, or is wide enough, the image background.png will be repeated ("tiled") throughout the page. Also, if the user scrolls the page, your background image will also scroll. If you do not want either or both of these things to happen, you will need to take a more modern approach, using styles rather than the bgsrc attribute: Body of page goes here
Styles provide more precise control and are the preferred method in modern browsers. One can also do this even more elegantly using a style sheet separate from the page. For a useful and detailed discussion of page backgrounds, see the background tutorial, on HTML Goodies.
|
| Visitor Comments |
|
No visitor comments posted. Post a comment
|
| Attachments |
|
No attachments were found.
|