NameSilo

HELP (will pay 200NP) CSS Style Sheet renders page improperly when using PHP for site

Spaceship Spaceship
Watch
Status
Not open for further replies.
Anyone who can help me figure this out, I will pay them 200 NP (or US $5 w/paypal).

I've created the index page of a website using a CSS Style Sheet. The page when it's in HTML looks fine but when I put it into a PHP page, it does not look fine. When on a PHP page, there's a blank space at the top and some of the content looks odd, and some text doesn't seem to be formatted properly, almost as if the CSS page isn't being called upon properly when the page is in PHP.

Here is the page in HTML
http://www.mybiblegames.com/index.html

Here is the page in PHP
http://www.mybiblegames.com/index.php

Here is the code behind the CSS file
Code:
@charset "utf-8";
/* CSS Document */
 
body{
	background-image:url('images/background.png');
	background-position:center;
	background-attachment:fixed;
	text-align:center;
	background-position:bottom;
	vertical-align:top;
	border:none;
	border-width:0;
	margin:0;
	padding:0;
	margin-top:0;
	font-family:Arial, Helvetica, sans-serif;
	font-size:14px;
}
 
.siteFrame{
	border:none;
	border-width:0;
	width:764px;
	margin:0;
	padding:0;
	text-align:left;
	margin-top:0;
	margin-left:0;
	margin-right:0;
	background-image:url('images/header.jpg');
	background-position:top;
	background-repeat:no-repeat;
	background-color:white;
}
 
 
 
/* Links */
a{
	color:#b0a310;
	font-weight:bold;
	text-decoration:underline;
}
a:hover{
	color:#7e896e;
	text-decoration:overline underline;
}
a:active{
	color:#426ae1;
	text-decoration:none;
}
a:visited{
	color:#897f0c;
}
 
 
 
/* Formated Text */
.contentSmallTitle{
	font-size:12px; 
	font-weight:bold; 
	color:white;
}
 
 
 
/* A content Box that fills the entire page horizontally */
.contentBox{
	background-image:url('images/contentBorder.png'); 
	width:754px;
}
.contentBoxInside{
	background-color:white; 
	width:740px; 
	text-align:left; 
	padding:4px;
}
.contentBoxShadow{
	width:754px; 
	height:8px; 
	background-image:url('images/contentBorderShadowBottom.gif'); 
	background-repeat:repeat-x;
}
.bibleVerse{
	font-family:"Times New Roman", Times, serif;
	font-size:14px;
	text-align:center;
}
 
 
 
/* A divided Content Box */
.divContentBox{
	width:764px;
}
.divLeftBox{
	margin: 0 0 0 5px; 
	float:left;
}
.divLeftBoxBorder{
	background-image:url('images/contentBorder.png'); 
	width:374px;
}
.divLeftBoxInside{
	background-color:white; 
	width:360px; 
	height:262px; 
	text-align:left; 
	padding:4px;
}
.divLeftBoxShadow{
	width:374px; 
	height:8px; 
	background-image:url('images/contentBorderShadowBottom.gif'); 
	background-repeat:repeat-x;
}
.divRightBox{
	margin: 0 0 0 381px;
}
.divRightBoxBorder{
	background-image:url('images/contentBorder.png'); 
	background-position:right; width:374px;
}
.divRightBoxInsideNonPadded{
	background-color:white; 
	width:368px; 
	text-align:left;
}
.divRightBoxShadow{
	width:374px; 
	height:8px; 
	background-image:url('images/contentBorderShadowBottom.gif'); 
	background-repeat:repeat-x;
}
 
 
 
/* Footer Related */
.footer{
	background-position:bottom;
	width:764px; 
	background-image:url('images/footerBackground.gif');
	background-repeat:repeat-x;
	height:38px;
	color:#cccbe7;
	font-size:12px; 
	vertical-align:bottom;
	line-height:1;
}
a.footerLinks{
	color:#e0ddc0;
	font-weight:bold;
	text-decoration:none;
}
a:hover.footerLinks{
	color:#c0c2e0;
	text-decoration:none;
}
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
on firefox they look the same
what browser? let me guess ie6?
can you pm me or attach a screenshot of what you see using .php?
 
0
•••
I'm using IE7 and FF3

Attached is what I'm seeing in IE7
 

Attachments

  • IE7-mybiblegames.jpg
    IE7-mybiblegames.jpg
    234.2 KB · Views: 42
0
•••
Would you be able to post what PHP code is at the top of your file; from what I can see nothing in the CSS would be causing this, so the problem must lie in that code.
 
0
•••
This is the code behind the php file


Code:
<?php

$title = "";
$keywords = "";
$description = "";

require('header.php');

?>

(site content here which I cut out to save room)

<?php

require('footer.php');

?>
 
0
•••
Okay, that looks alright up to there. Could we see header.php (if extra space needed you can use a site like www.paste.biz for pasting the code).
 
0
•••
I'll attach both header.php and footer.php


header.php
Code:
<!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>My Bible Games <?php if($title){ print " - $title"; };?> </title>
<script language="javascript">AC_FL_RunContent = 0;</script>
<script src="AC_RunActiveContent.js" language="javascript"></script>
<link href="styles.css" rel="stylesheet" type="text/css" />

</head><body><center>

<div class="siteFrame"><center>

<div style="height:200px;">
<!--url's used in the movie-->
<!--text used in the movie-->
<!-- saved from url=(0013)about:internet -->
<script language="javascript">
	if (AC_FL_RunContent == 0) {
		alert("This page requires AC_RunActiveContent.js.");
	} else {
		AC_FL_RunContent(
			'codebase', 'http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0',
			'width', '764',
			'height', '200',
			'src', 'header',
			'quality', 'high',
			'pluginspage', 'http://www.macromedia.com/go/getflashplayer',
			'align', 'middle',
			'play', 'true',
			'loop', 'true',
			'scale', 'showall',
			'wmode', 'transparent',
			'devicefont', 'false',
			'id', 'header',
			'bgcolor', '#ffffff',
			'name', 'header',
			'menu', 'true',
			'allowFullScreen', 'false',
			'allowScriptAccess','sameDomain',
			'movie', 'header',
			'salign', ''
			); //end AC code
	}
</script>
<noscript>
	<object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=9,0,0,0" width="764" height="200" id="header" align="middle">
	<param name="allowScriptAccess" value="sameDomain" />
	<param name="allowFullScreen" value="false" />
	<param name="movie" value="header.swf" /><param name="quality" value="high" /><param name="wmode" value="transparent" /><param name="bgcolor" value="#ffffff" />	<embed src="header.swf" quality="high" wmode="transparent" bgcolor="#ffffff" width="764" height="200" name="header" align="middle" allowScriptAccess="sameDomain" allowFullScreen="false" type="application/x-shockwave-flash" pluginspage="http://www.macromedia.com/go/getflashplayer" />
	</object>
</noscript>
</div>


<!-- Header Ends -->
<!-- Content Begins -->


footer.php
Code:
<!-- End Content -->
<!-- Begin Footer -->


</center></div><div class="footer"><br/>

<!-- Footer Links -->
	<a class="footerLinks" href="">Register</a> - <a class="footerLinks" href="">Settings</a> - <a class="footerLinks" href="">Comics</a> - <a class="footerLinks" href="">Games</a> - <a class="footerLinks" href="">E-Puzzed</a> - <a class="footerLinks" href="">Community</a> - <a class="footerLinks" href="">Login</a><br/>

<!-- Footer Text -->
	ยฉ Copyright 2008 MyBibleGames, Inc. All Rights Reserved.


</div></div></center>


<!-- Google Analytics -->

</body>
</html>
 
0
•••
If i look at the php version with firebug, it shows that two <script> tags and the <link> tag is inside the <body> for some reason, but in view source it shows up fine.
 
0
•••
I have faced the same problem twice today, seems strange. But i finally found the solution :

Your php files are saved as UTF8, so they contain invisible UTF tag at the beginning before first charachter (EFBBBF), you should remove it using a HEX editor. Php file should start with <?php and end with ?> to avoid such problems (Remove any EFBBBF at the beginning).

1.gif


Please let me know if it works, and don't forget about the $NP :hehe:
 
Last edited:
0
•••
el paon: Wow, you are like a genius, that actually worked! I've asked like 20+ people for help and your the only one who actually had the solution! Thanks.

NP sent.
 
0
•••
Some editors will add the BOM (byte order mark) when saving files to UTF-8 format.
 
0
•••
Yeah I was using Expression Web to do my updates but I will no longer use that for PHP editing.
 
0
•••
davideo7 said:
el paon: Wow, you are like a genius, that actually worked! I've asked like 20+ people for help and your the only one who actually had the solution! Thanks.

NP sent.

Thanks, I'm glad I could help you.
 
0
•••
Expressions is very finicky, and I hate it. I once was installing WordPress and one of my colleagues edited wp-config.php and uploaded it with Expressions, and it kept giving me "headers already sent errors". Turned out Expressions added invisible characters to the beginning of the file when uploading. Good catch, el_paon.
 
0
•••
Status
Not open for further replies.
Unstoppable Domains
Domain Recover
DomainEasy โ€” Payment Flexibility
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back