【发布时间】:2010-01-23 15:50:50
【问题描述】:
我是 Kohana 的新手(使用了 v3)。 当我运行 Hello World 示例时。 如果我链接到另一个 css 文件,则 css 不起作用。
原始示例效果很好。
让我们为我们的消息创建视图文件 application/views/site.php:
<html>
<head>
<title>We've got a message for you!</title>
<style type="text/css">
body {font-family: Georgia;}
h1 {font-style: italic;}
</style>
</head>
<body>
<h1><?php echo $message; ?></h1>
<p>We just wanted to say it! :)</p>
</body>
</html>
我将 Css 更改为像这样的另一个文件。我将 default.css 放在 application/views/default.css 的同一目录中 取而代之的是当前 ... 与 default.css。它不起作用! ?你能告诉我为什么以及如何解决它。谢谢。
<html>
<head>
<title>We've got a message for you!</title>
<LINK href="default.css" rel="stylesheet" type="text/css">
</head>
<body>
<h1><?php echo $message; ?></h1>
<p>We just wanted to say it! :)</p>
</body>
</html>
更新。
Logo.gif 也无法显示。 我创建了一个新文件夹“images”并在其中放置了一个 Logo.gif。 比如 application/views/images/Logo.gif
应用程序/views/site.php
<div id="header">
<div id="logo">
<p><img src="../index.php/images/Logo.gif" alt=""/></p>
<h1><?php echo $message; ?></a></h1>
<h2>We just wanted to say it! :)</h2>
</div>
</div>
它有什么问题?感谢阅读和回复。
【问题讨论】:
-
default.css 相对于您的 php 文件在哪里?
-
嗨文森特,我刚刚更新了帖子。 default.css 与 site.php 位于同一文件夹中。谢谢。
标签: php frameworks kohana