我正在尝试通过使用http://css3pie.com在 IE 中获得圆角的解决方法。我在我的 css 中包含了以下内容,它在页面加载时被加载。所有这些都在 Joomla 1.5 中加载。
.form_field {color:#222 !important; border:2px solid #333; background:#f4f4f4;-webkit- border-radius: 5px;
-moz-border-radius: 5px;
border-radius: 5px; color:#fff; padding:2px 0px 2px 0px; position:relative; z-index:99999;
behavior: url(./PIE.htc);
上面的代码保存在一个名为 template.css 的 css 文件中。
PIE.htc 和 PIE.php 位于我网站的根目录中。
下面是在 IE 9 中加载页面并选择 IE 8 渲染模式时生成的一些“视图源”。
<link rel="stylesheet" href="/sos/plugins/system/rokbox/themes/light/rokbox-style.css" type="text/css" />
<link rel="stylesheet" href="/sos/components/com_gantry/css/gantry.css" type="text/css" />
<link rel="stylesheet" href="/sos/components/com_gantry/css/grid-12.css" type="text/css" />
<link rel="stylesheet" href="/sos/components/com_gantry/css/joomla.css" type="text/css" />
<link rel="stylesheet" href="/sos/templates/sos/css/joomla.css" type="text/css" />
<link rel="stylesheet" href="/sos/templates/sos/css/customstyle.css" type="text/css" />
<link rel="stylesheet" href="/sos/templates/sos/css/extended.css" type="text/css" />
<link rel="stylesheet" href="/sos/templates/sos/css/sos-styles.css" type="text/css" />
<link rel="stylesheet" href="/sos/templates/sos/css/template.css" type="text/css" />
<link rel="stylesheet" href="/sos/templates/sos/css/typography.css" type="text/css" />
<link rel="stylesheet" href="/sos/templates/sos/css/fusionmenu.css" type="text/css" />
<script type="text/javascript" src="/sos/components/com_gantry/js/mootools-1.2.5.js"></script>
<script type="text/javascript" src="/sos/plugins/system/rokbox/rokbox-mt1.2.js"></script>
<script type="text/javascript" src="/sos/plugins/system/rokbox/themes/light/rokbox-config.js"></script>
从上面可以看出,正在加载 template.css 文件,如果我进入 chrome,则会执行 css3 边框半径代码,因此我知道文件正在加载。出于某种原因,当在 IE 中查看页面时,饼图行为不起作用。由于某种原因,角落只是左方:-S。即使它们显示为具有“form_field”类。我浏览了 CSS3PIE 网站上的故障排除文档,但似乎找不到任何解决方案。
编辑>>>>>>>>>>>>>>>>>>>>>>>>>>
我什至尝试将它放在我网站根目录下的自己的 css 文件中:
在源视图中单击它时会加载 css 文件,所以我知道这是有效的,在 css 文件中我有 @charset "utf-8";
/* CSS Document */
.form_field {border-radius: 5px !important; color:#fff !important; padding:2px 0px 2px 0px !important; position:relative !important; z-index:99999 !important;
behavior: url(./PIE.htc) !important;}
所以我现在唯一能想到的是,joomla 正在剥离一些东西,或者它与其他东西发生冲突:-S。
编辑 2 >>>>>>>>>>>>>>>>>>>>
好的,还是不行,我已经注释掉了我的 index.php 中的所有 js 文件,以确保没有任何东西会与它发生冲突,但仍然不行。
编辑 3 >>>>>>>>>>>>>>>>>>>>
最后!,为了其他人的利益,这里是如何使用 Joomla 和 CSS3PIE 做到这一点。不知道为什么它不能与 PIE.htc 一起使用,但如果你使用 PIE.php 代替它,它可以工作。
制作一个名为 PIE.CSS 的 css 文件,将其放在您的站点根目录中,在其中放入:
@charset "utf-8";
/* CSS Document */
.YOURCLASSNAME {border-radius: 5px !important; color:#fff !important; padding:2px 0px 2px 0px !important; position:relative !important; z-index:99999 !important;
behavior: url(./PIE.php) !important;}
接下来打开您的模板 index.php 文件并放入
<link rel="stylesheet" type="text/css" href="./PIE.css" />
接下来转到您想要样式的任何内容,例如文章中的一些表单字段,然后将:class="YOURCLASSNAME" 放在您想要样式的任何字段/ div 等上。
这应该是,手指交叉的工作。:-)