我是 Web 开发的新手(尤其是 CI 框架中的 php)。这个问题对你来说应该是一个非常简单的问题,但我已经用谷歌搜索了一个小时,仍然找不到任何解决方案。
我想显示一个图像(img文件夹中的 logo.png)并链接一个我放在根目录中的 css 文件( style文件夹中的 style.css ):
但是当我尝试显示图像并链接 css 时,我得到的只是一个空白的空网页。这是我的 html 代码:
<!DOCTYPE html>
<html>
<head>
<title>My First Design</title>
<link href="<?php echo base_url();?>style/style.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<h1><img src="../../img/logo.jpg" />My First Web Design</h1>
<p>
I have been working on honing, and in some cases, learning new graphical skills in the past few weeks. So, I have been extensively watching Adobe Illustrated tutorials and working on my existing Photoshop knowledge and basically trying to get a hang of the software beyond basic image editing and digital painting.
</p>
<p>
From a beginner’s point of view, the world of graphical design is quite vast… at times intimidating and there is no limit to creative options. One could branch out into any form of graphical design… illustrations or web-design or logo & advertising and so much more. At the same time, one does not need to limit the options to just these.
</p>
</body>
</html>
这是我的config.php
base_url :$config['base_url'] = 'http://localhost/ciGlassProject/';
我尝试了一些不同的方法,例如:
- 使用 site_url 而不是 base_url
- 手动输入网址
- 以多种方式更改
$config['base_url']
值。但是,它们都不起作用。