我有一个页面,其中包含从正文中的数据库中提取的一些内容,在头部我有一个链接到格式化该内容的外部样式表。在 Safari 上(在 Chrome 或 Firefox 上似乎没有)我得到了一个可爱的无样式内容的闪光。
我宁愿对此进行非javascript修复,有没有办法定位外部css工作表链接,以便在php脚本在正文中运行之前应用它?- 我认为它会自动执行此操作,但显然不是在野生动物园中,有什么想法吗?
<?php
require_once "../config/article_functions.php";
include "../widgets/topborder.html";
include "../widgets/banner.php";
include "../widgets/navbar.html";
?>
<!DOCTYPE html>
<html>
<head>
<link rel="stylesheet" type="text/css" href="http://example.org/widgets/article.css">
<style type="text/css">
a:link {color: inherit;} /* unvisited link */
a:visited {color: inherit;} /* visited link */
a:hover {color: inherit;} /* mouse over link */
a:active {color: inherit;} /* selected link */
body, html {
margin: 0;
padding: 0;
height:900px;
}
#container {
width:990px;
height:1000px;
margin-left:auto;
margin-right:auto;
}
#news_container {
width:740px;
}
</style>
<title> TODO </title>
</head>
<body>
<div id="container">
<?php include "../widgets/sidepanel.html"; ?>
<div id = "news_container">
<?php
$uri = explode('/', $_GET['$url']);
get_selected_news($uri[0]);
?>
</div>
</div>
</body>
</html>
一秒钟左右,我看到了这个:
然后之后: