- Impact
- 0
I'm creating a new skin for a php script and I've encountered a problem. (I'm still fairly new to css so I apologise if I my explanation may not be too clear) I positioned a bg image in the center of the page and made it stretch vertically. I then created a div that will center itself - this will contain all the content of the page. Unfortunately, there is an issue with centering in some browsers which I managed to find at http://www.positioniseverything.net/bg-centering.html . This is exactly what I'm experiencing as at times there's a difference of 1 px between the bg and div. Here is a screenshot of what I'd like it to always be and of the issue that sometimes occurs:


Now I read the solution posted at the url above but I'm not sure how I can incorporate it in my layout as I need the background image to stretch vertically to fit the size of the window.
Here's my code:
I have no idea how I can fix this issue and I'd appreciate any help in solving it.
Thanks,
Daniel


Now I read the solution posted at the url above but I'm not sure how I can incorporate it in my layout as I need the background image to stretch vertically to fit the size of the window.
Here's my code:
Code:
body {
background-color: #EEEEEE;
background-image: url('images/bg.gif');
background-repeat: repeat-y;
background-position: center;
color: #6F6F6F;
font-size: 11pt;
font-family: arial;
text-align: center;
min-width: 698px;
}
#wrapper {
margin: 0 auto;
width: 698px;
height: 900px;
text-align: center;
border-style: solid;
border-color: 6C6C6C;
border-top-width: 0px;
border-left-width: 1px;
border-right-width: 1px;
border-bottom-width: 0px;
}
#header {
margin: 0 auto;
width: 698px;
height: 78px;
text-align: center;
float: center;
border-width: 0px;
background-image: url('images/header_bg.gif');
background-repeat: repeat-x;
}
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title>{$list_name} - {$header}</title>
<link rel="stylesheet" type="text/css" media="screen" href="SmoothBlue.css" />
<script language="javascript">
function out(username)
{
image = new Image();
image.src= '{$list_url}/index.php?a=out&u=' + username;
}
</script>
</head>
<body>
<div id="wrapper">
<div id="header">
<img src="images/logo.gif" border="0" alt="Topsite" />
</div>
</div>
</body>
</html>
I have no idea how I can fix this issue and I'd appreciate any help in solving it.
Thanks,
Daniel









