代码之家  ›  专栏  ›  技术社区  ›  faressoft

如何将border-radius.htc与ie一起用于圆角

  •  4
  • faressoft  · 技术社区  · 15 年前

    如何将border-radius.htc与ie一起用于圆角

    我在用 border-radius.htc 在IE中固定边框半径

    在这里工作得很好 http://www.faressoft.org/eshterakat/border-radius/border-radius.html

    但它在我的html页面上不起作用!我不知道为什么! http://www.faressoft.org/eshterakat/

    -moz-border-radius:5px;
    -khtml-border-radius:5px;
    -webkit-border-radius:5px;
    border-radius:5px;
    behavior:url('Js/border-radius.htc'); 
    

    -

    /* I tried '../Js/border-radius.htc' it didn't work too */
    /* I tried '/Js/border-radius.htc' it didn't work too */
    /* I tried 'Js/border-radius.htc' it didn't work too */
    
    3 回复  |  直到 15 年前
        1
  •  4
  •   Chris Bentley    15 年前

    与宏达电有两个问题;

    • 如果您的on apache将其添加到配置或.htaccess:add type text/x-component.htc中,服务器必须使用正确的mime类型(text/x-component)为htc提供服务器

    • 在css中,url是相对于css文件的…htc引用与调用html页面相关-小心。

        2
  •  2
  •   Sergey Glotov Nitesh Khosla    14 年前

    只需编辑border-radius.htc

    fill.color = fillColor;
    

    进入之内

    fill.color = (fillColor=='transparent') ? 'none': fillColor;
    

    把css文件和htc文件放在同一个文件夹中,例如文件夹名 "cssSupport" 然后就像:

    zoom:1;
    display: block;
    background-color:Transparent;
    border: 1px solid #696;   
    -webkit-border-radius:8px;   
    -moz-border-radius:8px;   
    border-radius:8px;
    border-bottom-right-radius:8px;   
    border-bottom-left-radius:8px;   
    behavior:url(../CSS_Support/border-radius.htc);
    

    试试这个。一定会成功的。享受IE8。

        3
  •  1
  •   Graphical Insight    14 年前

    这实际上是一个具体的问题,这是非常简短地提到的。

    使用htc组件时,需要确保它们位于站点根位置。然后您只需提到行为:url(css3orw/e.htc);

    本说明中的url与在css中引用图像的方式不同。这将永远不需要您获取某些url(../../asf.ext)等,您可能习惯于使用css中图像的相对性质。