- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在开发 Joomla!模板,我有我的索引和我的 template.css
当我将所有设计留在 css 中时,它似乎只加载那些与 css 类相关的部分而没有做任何其他事情,所以最终我不得不将其他所有内容写入 de index.php,这很愚蠢,因为我不应该这样做。
例如,这是我想要的 index.php 代码
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="<?php echo $this->language; ?>" lang="<?php echo $this->language; ?>" >
<head>
<link rel="stylesheet" href="<?php echo $this->baseurl ?>/templates/posgradostemplate/css/template.css" type="text/css" />
<jdoc:include type="head" />
</head>
<body>
<div id="wrapper">
<div id="content">
<div class="mainmenu">
<jdoc:include type="modules" name="mainmenu" />
</div>
</div>
</div>
</body>
</html>
但是包装器和内容的行为与预期不符,并且没有显示背景。这是我的 CSS 文件:
html {
/* IE10 Consumer Preview */
background-image: -ms-linear-gradient(top, #E6E6E6 0%, #858585 100%);
/* Mozilla Firefox */
background-image: -moz-linear-gradient(top, #E6E6E6 0%, #858585 100%);
/* Opera */
background-image: -o-linear-gradient(top, #E6E6E6 0%, #858585 100%);
/* Webkit (Safari/Chrome 10) */
background-image: -webkit-gradient(linear, left top, left bottom, color-stop(0, #E6E6E6), color-stop(1, #858585));
/* Webkit (Chrome 11+) */
background-image: -webkit-linear-gradient(top, #E6E6E6 0%, #858585 100%);
/* W3C Markup, IE10 Release Preview */
background-image: linear-gradient(to bottom, #E6E6E6 0%, #858585 100%);
margin: 0;
padding: 0;
border: 0;
}
html, body {
height: 100%;
-webkit-box-sizing: border-box;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
body {
margin: 0;
}
.mainmenu ul {
font-family: Arial, Verdana;
font-size: 12px;
margin: 0;
padding: 0;
list-style: none;
}
.mainmenu ul li {
display: block;
position: relative;
float: left;
}
.mainmenu li ul {
display: none;
}
.mainmenu ul li a {
display: block;
text-decoration: none;
color: #ffffff;
border-top: 1px solid #000000;
padding: 5px 15px 5px 15px;
background: #000000;
margin-left: 1px;
white-space: nowrap;
}
.mainmenu li:hover li a:hover {
background: #FFFF00;
color: #FF0000;
}
.mainmenu ul li a:hover {
background: #000000;
color: #FFFF00;
}
.mainmenu li:hover ul {
display: block;
position: absolute;
}
.mainmenu li:hover li {
background: #FFFF00;
float: none;
font-size: 11px;
color : #000000;
}
.mainmenu li:hover a {
background: #FFFF00;
color : #000000;
}
#wrapper{
width: 100%;
text-align: center;
}
#content{
display: inline-block;
}
除了 mainmenu 之外的所有东西都没有按照 css 告诉它的那样工作。我在想它没有被正确加载,我希望它被急切地加载,所以一切都在脑海中。现在它只有在我在索引中添加 css 代码时才有效,但它不应该那样。有什么建议吗?
最佳答案
尝试使用以下方法加载 CSS 文件:
$document = JFactory::getDocument();
$document->addStyleSheet(JURI::root() . "templates/posgradostemplate/css/template.css");
关于css - Joomla 只加载 css 模板的某些部分,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14491122/
hello world tutorial对于 Joomla 状态: $mainframe is a global variable in Joomla that has lots of useful
我已经通过了:http://docs.joomla.org/How_to_add_breadcrumbs 和 http://api.joomla.org/Joomla-Framework/Applic
在为模块设置添加参数字段时,我正在寻找可能的过滤器列表。 我知道 Text form field type 的示例中存在 filter="raw"和 filter="integer". 但是这些字段的
关闭。这个问题需要更多focused .它目前不接受答案。 想改善这个问题吗?更新问题,使其仅关注一个问题 editing this post . 5年前关闭。 Improve this questi
是否可以为 Joomla 1.5 后端和前端实现单点登录。我发现当管理员例如在后端登录并且需要在前端执行一些用户功能时必须再次登录,这有点多余。有没有实现单点登录的方法? 最佳答案 乔姆拉!被实现为两
我们如何在 joomla 中渲染带有标题的模块。因为现在,我可以根据位置渲染模块,但它不包括模块标题。 这是我渲染模块的方式。 title); echo JModuleHelper::renderMo
我正在 joomla 中开发一个自定义搜索模块。所以我正在使用 joomla 的内置数据库连接和功能。 问题是我想在这个模块中使用分页类,但不知道任何提示。 请帮我解决这个问题。 谢谢。 最佳答案 第
关闭。这个问题是off-topic .它目前不接受答案。 想改进这个问题? Update the question所以它是on-topic对于堆栈溢出。 10年前关闭。 Improve this qu
我在joomla中使用youtube视频,其中代码如下:- [jv_youtube url="https://www.youtube.com/watch?v=8Di0IOQssOM&rel=0" wi
我使用 onContentPrepare 事件将此 [test] 更改为其他文本 o prinf html,如 wordpress 短代码,但没有任何变化。 出了什么问题? 这是shortcodejd
关闭。这个问题不符合Stack Overflow guidelines .它目前不接受答案。 要求我们推荐或查找工具、库或最喜欢的场外资源的问题对于 Stack Overflow 来说是偏离主题的,
请先转到www.espacioasir.com,然后注意第二篇文章如何“压碎”到左侧-文章正常宽度的一半。 无论如何,我认为我无法解释得更多,我的问题很清楚:为什么会这样?我确实想提及一下,本文的内容
有些人可能知道,Wordpress 在设置中有一个选项,允许在子目录中安装站点,同时将站点 URL 设为主域。它类似于“站点 url”和“Wordpress url”。我在 Joomla 中寻找类似的
我遇到的这种情况:安装了 joomlaxy/JSPT/Payplans 的 joomla 运行良好。 现在,我在/pages 文件夹中做了一个小的 php 脚本,用于在特定用户类型的模板中使用,它调用
我知道如何为 Joomla 1.6 创建一个模块。但是我听说可以在同一个 XML 安装文件中添加一组 Joomla 1.5 参数和一组 Joomla 1.6 参数,以使只有一个包与 1.6 和 1.5
自从昨晚 Joomla 3.0 Alpha 发布以来,我想尝试开始将我编写的 Joomla 2.5 组件转换为新的 Joomla 3.0。我一直在关注所有的开发小组,他们说 JController、J
我在 Joomla 1.5 中工作并开发了一个组件,该组件有 2 个 View ,在两个 View 中具有相同的部分。我正在重复代码,因为我在 2 个不同的 View 中使用了相同的代码。所以我想知道
我正在构建一个自定义 Joomla 组件,并将其添加到我的模板 (default.php) 文件(它使用 HTTP POST)中的表单中: echo JHTML::_( 'form.token' );
拿起 Joomla 的最快方法是什么?书籍,培训等?我们希望在 Joomla 中培训 10 名中高级 Java 开发人员。 最佳答案 如果你想节省时间,不要从官方的 joomla 文档开始。转至 ht
我之前以这种方式从 Joomla 文章中添加了 Joomla 模块:{loadmodule mod_name}但是这次我需要从中传递参数。 如何将文章中的参数传递给 Joomla 模块? 最佳答案 您
我是一名优秀的程序员,十分优秀!