Forum Moderators: not2easy
Error: The stylesheet http://www.example.myphotos.cc/style.php was not loaded because its MIME type, "text/html", is not "text/css".
[edited by: jatar_k at 5:27 am (utc) on July 30, 2005]
[edit reason] generalized url [/edit]
you might want to take a look at this thread
PHP in CSS files [webmasterworld.com]
I've tried to fix this for 2 days now ....
body
{
font-family: verdana, Verdana, Helvetica, courier, serif; background-color:#EBEBEB;
color:yellow; font-size: 13px; background-image: url('bakgrunn.jpg');
background-attachment: fixed; margin-top: 1px
}
div#main{
width:900px;
margin-left:auto;
margin-right:auto;
}
div#content{
float:right;
display:block;
width:700px;
height:400px;
margin-top: -400px;
}
div#header{
display:block;
position: static;
width:900px;
height:100px;
background-image: <?
$link="http://example.no/arnbir/index.html";
function checklink($link)
{
//see if we have a link to check
if($link)
{
//open the url
$file = @fopen ("$link", "r");
}
if($file)
{ return true ;
fclose($file);
}
}
if($link!="")
{
//show result if good
if((checklink($link))=="true")
{
echo "url('http://example.no/arnbir/baktop.jpg')";
}
else
{
//show result if bad
echo "url('http://www.example.org/baktop.jpg')" ;
}
}
?>;
background-repeat: repeat;
font-size: 3em;
}
div#footer{
display: block;
position: static;
width: 900px;
height: 100px;
background-image:<?
{
//show result if good
if((checklink($link))=="true")
{
echo "url('http://example.no/arnbir/bunn.jpg')";
}
else
{
//show result if bad
echo "url('http://www.example.dyndns.org/bunn.jpg')" ;
}
}
?>;
background-repeat: no-repeat;
}
div#footer2{
display: block;
position: static;
margin-top: -40px;
margin-left:auto;
margin-right:auto;
width: 30px;
height: 30px;
}
div#headermeny {
display: block;
margin-left:auto;
margin-right:auto;
float: right;
margin-top: -20px;
position: static;
width: 700px;
height: 20px;
color: white;
font-size: 8;
/*background-image: url('test.png');*/
}
div#gradient {
display: block;
position: static;
width: 200px;
/*margin-top: -400px;*/
height: 200px;
background-image:<?
{
//show result if good
if((checklink($link))=="true")
{
echo "url('http://example.no/arnbir/bakmidopp.jpg')";
}
else
{
//show result if bad
echo "url('http://www.example.org/bakmidopp.jpg')" ;
}
}
?>;
background-repeat: repeat;
}
div#gradient2 {
display: block;
position: static;
width: 200px;
/*margin-top: -400px;*/
height: 200px;
background-image:<?
{
//show result if good
if((checklink($link))=="true")
{
echo "url('http://example.no/arnbir/bakmidopp.jpg')";
}
else
{
//show result if bad
echo "url('http://www.example.org/bakmidopp.jpg')" ;
}
}
?>;
background-repeat: repeat;
}
a{ color: #FCFCFC; font-weight: bold; font-size: 13px; }
a:visited { color: #FEE404; font-weight: bold; font-size: 13px; }
a:hover { color: #000000; font-weight: bold; font-size: 13px; }
a:active { color: #990000; font-weight: bold; font-size: 13px; }
div#meny3{
width: 150px;
display: block;
margin-left: auto;
margin-right: auto;
/*background: yellow;*/
color: yellow;
font-size: 11px;
}
div#meny {
width: 150px;
display: block;
margin-left: auto;
margin-right: auto;
/*background: yellow;*/
color: black;
font-size: 13px;
}
div#kontakt{
width: 150px;
display: block;
margin-left: auto;
margin-right: auto;
/*background: yellow;*/
color: white;
font-size: 13px;
font-weight: bold;
}
ul{margin-top: 0px;}
li{
margin-left: -40px;
list-style: none;
}
div#menytop
{
display: block;
width: 150px;
margin-left: auto;
margin-right: auto;
margin-top:10px;
background: black;
color: yellow;
font-weight: bold;
font-size: 13px;
}
div#menytop p {
font-weight: bold;
text-align: center;
margin-bottom: 0pt;
}
[edited by: jatar_k at 6:28 am (utc) on July 30, 2005]
[edit reason] removed urls [/edit]
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html lang="no" xml:lang="no" xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="content-type" content="text/html;charset=iso-8859-1" />
<title>Web-design og PC-reparasjon </title>
<link rel="stylesheet" type="text/css" href="style.php" />
</head>
<body>
<div align="center">
<table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="900" height="25"></td>
</tr>
<tr>
<td>
<div id="header"> </div>
</td>
</tr>
</table>
</div>
<div align="center">
<table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="900" height="38">
<div id="meny">
<table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td width="500" height="38"></td>
<td width="200" height="38">galleri</td>
<td width="200" height="38">Om Meg</td>
</tr>
</table>
</div>
</td>
</tr>
</table>
</div>
<div align="center">
<table width="900" border="0" cellspacing="0" cellpadding="0">
<tr>
<td>
<div id="hoved"></div>
</td>
</tr>
</table>
</div>
</body>
</html>
<?
$link="http://example.no/arnbir/index.html";
function checklink($link)
{
//see if we have a link to check
if($link)
{
//open the url
$file = @fopen ("$link", "r");
}
if($file)
{ return true ;
fclose($file);
}
}
if($link!="")
{
//show result if good
if((checklink($link))=="true")
{
echo "url('http://example.no/arnbir/baktop.jpg')";
}
else
{
//show result if bad
echo "url('http://www.example.org/baktop.jpg')" ;
}
}
?>;
I allways let my customers view the pages on my server before uploading to the web.
Can i send you a pm with the url I have been testing this on?
I got it to work just adding the to the header div.
sorry have to go to bed, it's late and I have to go pick up my daughter early, I feel really badly leaving you hanging but there are more than enough competent folk around to lend a hand.