I'm quite new to all of this, so I'm not immediatly seing what I'm doing wrong here.
I'm experimenting with css/php/mysql and have come accross a problem with my background image which is not displayed over the whole screen and instead leaves a white space at the right and bottom side.
To display the image, I'm using a css style and than a link to the image in the html code of my page:
When I'm using the same coding in html, than the image is over the whole screen, but in a .php extention, it is not.
Is there a limitation in CSS when using php? Or what am I missing here?
This is the css bit of the coding:
- Code: Select all
.bg {
width: 100%;
height: 100%;
position: absolute;
margin: 0 0 0 0;
margin-bottom:0px;
margin-right:0px;
top: 0;
left: 0;
z-index: -5000;
}
div.transbox
{
width:900px;
height:90%;
top: 5%;
position: relative;
background-color:#ffffff;
border:1px solid white;
overflow: auto;
opacity:0.8;
filter:alpha(opacity=80); /* For IE8 and earlier */
}
And this is the code in my php page:
- Code: Select all
<?php session_start(); ?>
<html>
<div id="background" align="center"><img src="images/Tina/Sauna_Relax_15989324.jpg" class="bg">
<head>
<link rel="stylesheet" type="text/css" href="Styles/GeneralStylesTina.css" />
<?php
$_SESSION['mode']= "";
?>
</head>
<body>
<div id="background" align="center"><img src="images/Tina/Sauna_Relax_15989324.jpg" class="bg"></div>
<div id="maindiv1" align="center">
<div id="transbox" class="transbox">
<div id="maindiv3" align="left" style="padding: 50px 50px 50px 50 px">
<?php
## Make the connection with the database
require_once 'db_access.php';
## Get the POST parameters
$username = mysql_real_escape_string($_POST[username]);
$password = mysql_real_escape_string($_POST[password]);
## Check if username and password are not empty
if ($username=="")
{
$_SESSION['login']=0;
echo "<p> </p>";
echo "Gelieve uw gebruikersnaam in te vullen!";
echo "<p> </p>";
echo '<a href="logintina.html" class="fout"><span>Keer terug</span></a>';
echo "<p> </p>";
goto waypoint1;
}
elseif ($password=="")
{
$_SESSION['login']=0;
echo "<p> </p>";
echo "Gelieve uw wachtwoord in te vullen";
echo "<p> </p>";
echo '<a href="logintina.html" class="fout"><span>Keer terug</span></a>';
echo "<p> </p>";
goto waypoint1;
}
else
{
}
## check if username is in the database
$query = "SELECT * FROM DB_Users WHERE FL_Username='$username';";
$res = mysql_query($query);
if (mysql_num_rows($res) > 0)
{
goto waypoint2;
}
else
{
$_SESSION['login']=0;
echo "<p> </p>";
echo "De gebruikersnaam bestaat niet.";
echo "<p> </p>";
echo '<a href="logintina.html" class="fout"><span>Keer terug</span></a>';
echo "<p> </p>";
goto waypoint1;
}
waypoint2:
## check if the password corresponds with the username
$sql="SELECT * FROM DB_Users WHERE FL_Username='$username' and FL_Password='$password'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);
if($count==1)
{
}
else
{
$_SESSION['login']=0;
echo "<p> </p>";
echo "Het wachtwoord is niet correct";
echo "<p> </p>";
echo '<a href="logintina.html" class="fout"><span>Keer terug</span></a>';
echo "<p> </p>";
}
## maak 2 verschillende login's op basis van type login.
## Haal het User Type bij de Username
$detail = Type;
$sql = "SELECT FL_".$detail." FROM DB_Users WHERE FL_Username='$username'";
$result = mysql_query($sql);
$users_type = mysql_fetch_row($result);
$users_type = $users_type[0];
## Geef de link weer op basis van het UserType
if ($users_type == "klant")
{
$_SESSION['login']= '1';
$_SESSION['username']= $username;
echo "<p> </p>";
echo "U bent ingelogd";
echo "<p> </p>";
echo '<a href="LoginOrderingSucces.php" class="fout"><span>Ga verder</span></a>';
echo "<p> </p>";
}
else
{
$_SESSION['login']= '2';
$_SESSION['username']= $username;
echo "<p> </p>";
echo "U bent ingelogd als verkoper";
echo "<p> </p>";
echo '<a href="LoginOrderingVerkoperSucces.php" class="fout"><span>Ga verder</span></a>';
echo "<p> </p>";
}
waypoint1:
?>
</div>
</div>
</div>
</body>
</html>
Thank you for your help,
Joachim

