CSS3 background-origin property does work in firefox?

自作多情 提交于 2020-01-06 07:05:21

问题


I want use CSS3 property to make a complicated background image which with corner shadow and so on.Including background image,left border image,right border image.So,for the <div class="outer"></div>I write the CSS below:

    .outer
    {
        background:url("title_main.png");
        background-repeat:repeat-x;

        background-clip: content;
        background-origin:content;
        -moz-background-clip: content;
        -moz-background-origin: content;
        -webkit-background-clip: content;
        -webkit-background-origin:content;


        -webkit-border-image:url("title_border.png") 0 15 0 15 stretch;
        -moz-border-image: url("title_border.png") 0 15 0 15 stretch;
        border-image:url("fancy_title.png") 0 15 0 15 stretch;
        border-width:0 15px ;

        width:80px;
        height:32px;
    }

In chrome browser it work well like:

But the firefox doesn't like this:

Why would this happened?How can I fix this?Make the firefox effect like the chrome?


回答1:


The values of the background-origin property are content-box, padding-box, and border-box, according to the spec. So what you want is:

.outer {
    -webkit-background-origin: content;
    -moz-background-origin: content; /* Firefox 3.6 and below */
    background-origin: content-box; /* Firefox 4 and above */
    /* etc. */
}


来源:https://stackoverflow.com/questions/4578425/css3-background-origin-property-does-work-in-firefox

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!