Php 如何在codeigniter中加载css?
当我试图加载css文件时,codeigniter中有一些代码不起作用。如何在codeigniter中加载css,也许我的代码是错误的。你能告诉我如何在我的代码中求解吗Php 如何在codeigniter中加载css?,php,html,css,codeigniter,Php,Html,Css,Codeigniter,当我试图加载css文件时,codeigniter中有一些代码不起作用。如何在codeigniter中加载css,也许我的代码是错误的。你能告诉我如何在我的代码中求解吗 <!doctype html> <html lang="en"> <head> <meta http-equivn="Content-Type" content="text/html: charset=UTF-8"/> <titl
<!doctype html>
<html lang="en">
<head>
<meta http-equivn="Content-Type" content="text/html: charset=UTF-8"/>
<title>Taekwondo</title>
<link rel="stylesheet" href="<?php echo base_url(); ?>assets/css/tkd.css" type="text/css" media="screen">
</head>
<body>
<!--head-->
<div id="box-wrapper">
<!--Header-->
<header>
<!--top info-->
<div id="top-info">
<div class="row">
<div class="twelve column top-desc">
<ul>
<li><span>Login/Register</span></li>
</ul>
</div>
</div>
</div>
<!--top info end here-->
<div class="row">
<div>
<div class="twelve column">
<div id="left-header">
<!--logo start here-->
<div id="logo">
<a href="home.php"><img src="assets/img/logo.png" alt="main-logo" class="retina"></a>
</div>
<!--logo end here-->
</div>
</div>
</div>
</div>
</header>
</div>
</body>
</html>
跆拳道
根据您的评论,我认为您没有在application/config/autoload.php中加载url帮助程序
文件
试试这个:
<link rel="stylesheet" type="text/css" href="<?php echo base_url("assets/css/tkd.css");">
该代码段将输出以下HTML:
<link href="css/mystyles.css" rel="stylesheet" type="text/css" />
必须首先加载函数链接标签
它可以在HTML\U帮助程序中找到
信用证:您的错误是什么?你走错路了吗?css不起作用。。如何在codeigniter中加载css?试试我的答案。如果不工作,请查看您的html源代码并检查css文件路径。谢谢您的回答,但当我尝试它不工作时。我已经检查了assets/css/tkd.cssNo中的css文件路径。我要的是完整路径。查看您的源代码并检查链接标签href。
<link rel="stylesheet" type="text/css" href="<?php echo base_url("assets/css/tkd.css");">
<?php echo link_tag('css/mystyles.css'); ?>
<link href="css/mystyles.css" rel="stylesheet" type="text/css" />