Jump to content

Background Not Showing In Firefox


drexx
 Share

Recommended Posts

Hi everyone,First of all, I want to say thanks to w3schools for the great tutorials. This is my first post here. And I'm still practicing so I can learn more.Screenshots of firefox, and IE respectively:firefo10.jpgintern10.jpgMy page code is:You may ignore the php since it works 100%. :)

<?php	if ( isset($_COOKIE['username_login']) && isset($_COOKIE['password_login']) ) {			setcookie("username_login", $_COOKIE['username_login'], time()+600); 		setcookie("password_login", $_COOKIE['password_login'], time()+600); 		header("Location: principal.php");		exit;	}	$username_login = $_POST['username_login'];	$password_login = $_POST['password_login'];	$password_login = md5($password_login);		if ( $username_login != "" AND $password_login != "" ) {				include("startup.php");								$result = mysql_query("SELECT * FROM `membersLogin` WHERE username = '{$username_login}' AND password = '{$password_login}' LIMIT 1", $connection);							if ( mysql_num_rows($result) == 1 ) {				setcookie("username_login", $username_login, time()+600); 				setcookie("password_login", $password_login, time()+600); 				header("Location: principal.php");				exit;			}						include("startup_close.php");		}?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=utf-8" /><title>Treinador de futebol</title><link href="stylesheet.css" media="all" rel="stylesheet" type="text/css" /></head><body><br /><div id="structure"><h1>Login:</h1><hr /><?phpif ( isset($_POST['username_login']) )	echo "<span class=\"style1\"><img src=\"/Imagens/warningSign.png\" alt=\"Warning\" width=\"16\" height=\"16\" /> O nome de utilizador nao existe ou a password esta errada.</span>"?><form action="index.php" method="post">  <table width="250px" border="0" cellspacing="0" cellpadding="0">	<tr>	  <td><p>Nome</p></td>	  <td><input name="username_login" type="text" value="<?php if ( isset($_POST['username_login']) ) echo $_POST['username_login']; ?>" maxlength="15" /></td>	</tr>	<tr>	  <td><p>Password</p></td>	  <td><input name="password_login" type="password" maxlength="15" /></td>	</tr>  </table>  <br />  <table width="15%" border="0" cellspacing="0" cellpadding="0">	<tr>	  <td><p>		<input name="submit" type="submit" value="Entrar" />	  </p></td>	</tr>  </table></form><br /><br /><br /><br /><h1>Cria a tua conta:</h1><hr />Torna-te membro deste site. É fácil e grátis. <a href="register.php">Clica aqui para te registares!</a></div></body></html>

My stylesheet is:

html {	height: 100%;	width: 100%;}body {	background-image: url(/Imagens/backfinal.jpg);	background-repeat: no-repeat;	background-position: center;	background-attachment: fixed;	height: 100%;	width: 100%;	margin: 0px;	padding: 0px;	border: 0px;	font-family: Calibri, Verdana, Arial, Helvetica, sans-serif;	font-size: 10pt;	line-height: 10pt;	overflow: hidden;}h1 {	font-size: 12pt;}#structure {	width: 215px;	margin: 0px;	padding: 50px;}#principal {	align: center;	vertical-align: center;	margin: 0px;	padding: 50px;}#celula { 	height: 25px;}.style1 { 	color: #FF0000;}

There are 2 problems:1. The background does not show in firefox.2. The <div class="style1"> does not show in red in firefox.There is a way to go around, but is not the point of having a stylesheet which is what dreamweaver made, placing in my page <head>:

<style type="text/css"><!--body {	background-image: url(/Imagens/backfinal.jpg);	background-repeat: no-repeat;	background-position: center;	background-attachment: fixed;}.style1 {	color: #FF0000;}--></style>

It works, but I prefer to have it in my CSS so I don't repeat myself which is the point of programmers.Thank you :)

Edited by drexx
Link to comment
Share on other sites

I don't see a ; at the end of either of your .style1 color declarations.
Sorry, the mistake is only here, when i was making the 1st post i decided to change from
.style1 { color: #FF0000 }

to

.style1 {	color: #FF0000}

now is

.style1 {	color: #FF0000;}

:)still have the problem anyway :S

Edited by drexx
Link to comment
Share on other sites

Try assigning the background to both the html and body elements:

html,body {	background-image: url(/Imagens/backfinal.jpg);	background-repeat: no-repeat;	background-position: center;	background-attachment: fixed;}

Link to comment
Share on other sites

Try assigning the background to both the html and body elements:
html,body {	background-image: url(/Imagens/backfinal.jpg);	background-repeat: no-repeat;	background-position: center;	background-attachment: fixed;}

It works! Thank you! :)
Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

×
×
  • Create New...