开发者

Strange HTML ignoration of a tag

HTML seems to com开发者_StackOverflow社区pletely and utterly ignore this:

<link rel="stylesheet" type="text/css" href="../public_html/CSS.php?W=1"/>

It's in the head, and links to a PHP css stylesheet. Here's that stylesheet. I left some out of the if statement, purely to see if it was the statement itself not working.

<?php header("Content-type: text/css"); ?>

div{
color:green;
}

body{
background-color:blue;
}

<?
if ($_GET["W"] == 1){?>

div{
color:green;
}

.Center{
align:center;
}

.Login{
border:5px solid green;
align:center;
}

<? } ?>


The public_html folder name is a typical name of the web root folder on the local disk file system. This folder is by itself not published in the web, only its contents are. The href attribute of the <link> element should point to a web path, not to a local disk file system path.

Assuming that public_html folder is indeed your web root folder and that the PHP file containing the <link> element is also there, then the CSS file should rather be linked as follows:

<link rel="stylesheet" type="text/css" href="CSS.php?W=1"/>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜