2

I am wondering how I could set the background image to keep its position on this site: http://www.jylkkari.fi/wordpress/

When you drag the browser under 960 px wide, the background of sidebar starts to move towards center.

I found out this Javascript which could solve this problem.

I am still searching if there is a easy way in CSS to keep the image centered while browser width is more than 960 px and on fixed while it is under this size?

Community
  • 1
  • 1
Ipi
  • 53
  • 4

3 Answers3

0

.......................... Define your body

min-width:980px;

body{
min-width:980px;
}

--------------for ie

used to ie condition css as like this

 <!--[if lt IE 8]>
    <link rel="stylesheet" type="text/css" href="ie8-and-down.css" />
<![endif]-->  

create a css file

body{width:980px;}  

more info about ie css click here

Rohit Azad Malik
  • 31,410
  • 17
  • 69
  • 97
0

Do this by adding width: 960px; to the element the background statement is on (in your case this would be body).

ranieuwe
  • 2,268
  • 1
  • 24
  • 30
0

You can use a media query, to change the CSS of the body when it reaches a certain width:

@media all and (max-width: 960px) {
  body {
    background-position: left center;
  }
}
LeonardChallis
  • 7,759
  • 6
  • 45
  • 76