Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

html - body backgorund image is repeating

Tags:

html

As you can see in this page - http://www.white-cell.com/events.htm - at the bottom, the background image is repeating because of the long text. the line that related to this is:

<body topmargin="0" leftmargin="0" marginwidth="0" marginheight="0" background="images/bg_wide.gif">

thank you!

like image 767
Ronny Avatar asked Dec 12 '25 04:12

Ronny


2 Answers

Use CSS to both specify your background image (background is very deprecated) and to turn off the repeating.

Put this in your head section:

<style type="text/css">
body
 {
     background-image: url(images/bg_wide.gif);
     background-repeat: no-repeat;
 }
 </style>

There is also a property to position the background image (background-position).

more on defining backgrounds at w3schools

like image 73
Pekka Avatar answered Dec 14 '25 17:12

Pekka


You can use this style and keep image from repeating:

body {
  background:url(images/bg_wide.gif) no-repeat;
}

The no-repeat will keep image from repeating.

like image 36
Sarfraz Avatar answered Dec 14 '25 17:12

Sarfraz