簡體   English   中英

邊界半徑IE8不起作用

[英]Does not work border-radius IE8

要在IE8中實現border-radius,我使用border-radius.htc

正確工作的塊realzovat border-radius:

.mc-button
{
    -moz-transition: all 0.218s ease 0s;
    -moz-user-select: none;
    background-color: #CBCBCB;
    background-image: -moz-linear-gradient(center top , #CBCBCB, #DCDCDC);
    border: 1px solid #DCDCDC;
    color: #FFFFFF;
    cursor: default;
    display: inline-block;
    font-size: 11px;
    font-weight: bold;
    height: 29px;
    line-height: 29px;
    min-width: 70px;
    padding: 0 8px !important;
    text-align: center;
    overflow: visible;
    font-family: inherit;
    font-size: inherit;
    float: left;
    text-decoration: none;
    display: block;
    -webkit-border-radius: 5px;
    -khtml-border-radius: 5px;
    -moz-outline-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    font-family: Arial, Sans-Serif !important;
    behavior:url(Content/border-radius.htc);
}

根據附件的列表-border-radius.htc連接到頁面

你能告訴我如何解決這個問題嗎?

更新(06/13/2012)

如果代碼被按鈕替換:

.mc-button
{
    border: 1px solid #696;
    height: 29px;
    line-height: 29px;
    min-width: 70px;
    text-align: center;
    padding: 0 8px !important;
    overflow: visible;
    -webkit-border-radius: 5px;
    -moz-border-radius: 5px;
    border-radius: 5px;
    float: left;
    display: block;
    background: #00ADEE;
    background: -webkit-gradient(linear, 0 0, 0 bottom, from(#00ADEE), to(#0078A5));
    background: -webkit-linear-gradient(#00ADEE, #0078A5);
    background: -moz-linear-gradient(#00ADEE, #0078A5);
    background: -ms-linear-gradient(#00ADEE, #0078A5);
    background: -o-linear-gradient(#00ADEE, #0078A5);
    background: linear-gradient(#00ADEE, #0078A5);
    -pie-background: linear-gradient(#00ADEE, #0078A5);
    behavior: url("Content/PIE.htc");
}

並聲明為:

<a id="login_button" class="mc-button mc-button-submit ">SomeText</a>

.mc-button-submit
{
    border: 0px solid #0076A3;
    background: #00ADEE;
    background: -webkit-gradient(linear, 0 0, 0 bottom, from(#00ADEE), to(#0078A5));
    background: -webkit-linear-gradient(#00ADEE, #0078A5);
    background: -moz-linear-gradient(#00ADEE, #0078A5);
    background: -ms-linear-gradient(#00ADEE, #0078A5);
    background: -o-linear-gradient(#00ADEE, #0078A5);
    background: linear-gradient(#00ADEE, #0078A5);
    -pie-background: linear-gradient(#00ADEE, #0078A5);
    color: #FFFFFF;
    text-align: center;
}

四舍五入消失。 添加到.mc-button-submit行中的行為:url(“ Content / PIE.htc”); 沒有幫助。

你能告訴我如何用背景參數連接第二類嗎?

獨立的.htc hack不能同時用於背景gradientborder-radius

嘗試用簡單的圖像替換css gradient 這個技巧將起作用。

您也可以使用css3pie (感謝@ dop-trois)—這個純Javascript工具比獨立的.htc文件更完美。

PS。 兩種方法都不能實現插入box-shadow

PPS:您需要的代碼在這里:(我對其進行了一些更改,以使其更加有效和正確):

.mc-button {
    font: bold 11px/29px Arial, Helvetica, sans-serif !important;
    text-align: center;
    text-decoration: none;
    color: #FFFFFF;

    border: 1px solid #DCDCDC;
    height: 29px;
    min-width: 70px;
    padding: 0 8px !important;
    overflow: visible;
    display: block;

    float: left;

    /* Unique link for this gradient — http://www.colorzilla.com/gradient-editor/#cbcbcb+0,dcdcdc+100;Custom */
    background-color: #CBCBCB;
    background: -moz-linear-gradient(top,  rgba(203,203,203,1) 0%, rgba(220,220,220,1) 100%); /* FF3.6+ */
    background: -webkit-gradient(linear, left top, left bottom, color-stop(0%,rgba(203,203,203,1)), color-stop(100%,rgba(220,220,220,1))); /* Chrome,Safari4+ */
    background: -webkit-linear-gradient(top,  rgba(203,203,203,1) 0%,rgba(220,220,220,1) 100%); /* Chrome10+,Safari5.1+ */
    background: -o-linear-gradient(top,  rgba(203,203,203,1) 0%,rgba(220,220,220,1) 100%); /* Opera 11.10+ */
    background: -ms-linear-gradient(top,  rgba(203,203,203,1) 0%,rgba(220,220,220,1) 100%); /* IE10+ */
    background: linear-gradient(top,  rgba(203,203,203,1) 0%,rgba(220,220,220,1) 100%); /* W3C */

    /* css3 stuff below: (via css3please.com) */
    /* no one prefix except `-webkit` is needed nowadays for `border-radius` */
    -webkit-border-radius: 5px;
            border-radius: 5px;
    -webkit-transition: all 0.218s ease-out;
       -moz-transition: all 0.218s ease-out;
        -ms-transition: all 0.218s ease-out;
         -o-transition: all 0.218s ease-out;
            transition: all 0.218s ease-out;

    /* PIE specific accordingly http://css3pie.com/documentation/q-and-a/ */
    behavior: url(PIE.htc);
}

您應該確保正確包含了PIE.htc (重要!)

相關問題

相應地,可能的問題可能是mime類型(“文本/ x組件”)。

也可能的解決方案可能是:

position: relative;
z-index: 0;

要應用漸變和邊界半徑,我建議使用CSS3 Pie 我知道,這是在IE中應用CSS3屬性的最強大的工具

在IE中應用漸變):

#myElement {
    background: #CCC; /*fallback for non-CSS3 browsers*/
    background: -webkit-gradient(linear, 0 0, 0 100%, from(#CCC) to(#EEE)); /*old webkit*/
    background: -webkit-linear-gradient(#CCC, #EEE); /*new webkit*/
    background: -moz-linear-gradient(#CCC, #EEE); /*gecko*/
    background: -ms-linear-gradient(#CCC, #EEE); /*IE10*/
    background: -o-linear-gradient(#CCC, #EEE); /*opera 11.10+*/
    background: linear-gradient(#CCC, #EEE); /*future CSS3 browsers*/
    -pie-background: linear-gradient(#CCC, #EEE); /*PIE*/
    behavior: url(PIE.htc);
}​

在IE中應用邊界半徑):

#myAwesomeElement {
    border: 1px solid #999;
    -webkit-border-radius: 10px;
    -moz-border-radius: 10px;
    border-radius: 10px;
    behavior: url(path/to/PIE.htc);
}​

您將需要PHP才能使其正常工作。

CSS3 Pie網站上的現場演示

順便說一句:使用此工具可以同時應用邊界半徑和漸變;)

希望這可以幫助 :)

要應用漸變,框陰影和邊界半徑,我建議使用CSS3 Pie。 我在cook&smile項目中使用了它,並且在IE中完全可以使用。

*{ behavior:url(path/PIE.htc);}

.border_radius_div{ position:relative; -webkit-border-radius: 10px; -moz-border-radius: 10px;  border-radius: 10px;}

.gradient_div{ position:relative; 
background: #EEFF99;
background: -webkit-gradient(linear, 0 0, 0 bottom, from(#EEFF99), to(#66EE33));
background: -webkit-linear-gradient(#EEFF99, #66EE33);
background: -moz-linear-gradient(#EEFF99, #66EE33);
background: -ms-linear-gradient(#EEFF99, #66EE33);
background: -o-linear-gradient(#EEFF99, #66EE33);
background: linear-gradient(#EEFF99, #66EE33);
-pie-background: linear-gradient(#EEFF99, #66EE33); }

訪問此網站進一步探索自己。

http://css3pie.com

注意:

  1. 不要忘記在使用邊界半徑,漸變和陰影的位置使用位置(相對或絕對)。

  2. 不要忘記使用behavior:url(xhtml_folder/PIE.htc);

  3. 重要的是不要忘記將PIE.htc放在xhtml文件夾中。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM