我正在使用Joomla! 3.0,其中包括Twitter Bootstrap 2.1.0。我想做我自己的Joomla!模板,则需要使用下拉菜单。当我包含以下CSS / JS时:
<script src="http://code.jquery.com/jquery-1.9.1.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseurl ?>/media/jui/js/bootstrap.min.js"></script>
<script type="text/javascript" src="<?php echo $this->baseurl ?>/media/jui/css/bootstrap.css"></script>
<link href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/Site.css" rel="stylesheet" type="text/css">
<link rel="shotcut icon" href="<?php echo $this->baseurl ?>/templates/<?php echo $this->template; ?>/css/images/favicon.ico" type="image/x-icon">
我收到以下CSS错误:
Uncaught SyntaxError: Unexpected token {
在
/media/jui/css/bootstrap.css
中,第19行 最佳答案
您有语法错误,因为您尝试将CSS文件包含在JavaScript中,因此请进行更改
<script type="text/javascript" src="<?php echo $this->baseurl ?>/media/jui/css/bootstrap.css"></script>
至
<link href="<?php echo $this->baseurl ?>/media/jui/css/bootstrap.css" rel="stylesheet" type="text/css" />
还要使用
/>
正确关闭其他链接标签,而不仅仅是>