2014-02-05 199 views
2

我有一個使用線性漸變爲邊界的圖像給它一些漸變邊框邊界圖像圓角

<div class = "gradborders" id="mydiv" runat="server"> 
..various elements... 
</div> 
.... 
.... 
.gradborders{ 
border-image: -webkit-linear-gradient(45deg, rgba(20,20,20,0.7) 5%, rgba(90,90,90,0.5) 35%, rgba(255,255,255,0.2) 100%) 8 stretch; 
border-image: -o-linear-gradient(45deg, rgba(20,20,20,0.7) 5%, rgba(90,90,90,0.5) 35%, rgba(255,255,255,0.2) 100%) 8 stretch; 
border-image: -moz-linear-gradient(45deg, rgba(20,20,20,0.7) 5%, rgba(90,90,90,0.5) 35%, rgba(255,255,255,0.2) 100%) 8 stretch; 
border-image: linear-gradient(45deg, rgba(20,20,20,0.7) 5%, rgba(90,90,90,0.5) 35%, rgba(255,255,255,0.2) 100%) 8 stretch;} 

一個div,我想圓潤邊角。我試圖通過將這種標準方式添加到越南境內:

border-radius: 8px; 
-webkit-border-radius: 8px; 
-moz-border-radius: 8px; 

但沒有骰子。我甚至嘗試在div上使用AJAX Rounded Corner擴展器,我確信它可以正常工作,但這也不起作用。有任何想法嗎??

回答

1

也許這樣的事情JSFiddle會做:

<div class="container"> 
    <div class="gradborders">hi</div> 
</div> 

.container{border-radius: 10px;overflow:hidden;} 
.gradborders{ 
-webkit-border-image: url("http://photos-f.ak.fbcdn.net/hphotos-ak-ash4/1686_520555094669668_1347475803_n.jpg") 8;} 
+0

奇怪的是,只有舍入左上角 – twinPrimesAreEz

+0

沒關係,這個工程......其實我有一些額外的元素在我的風格中,我並不需要阻止它工作(border-width和background-clip:padding-box;)。一旦我刪除了這些,這個工作 – twinPrimesAreEz

+0

太糟糕了,你只使用了'-webkit-'前綴和一個沒有保留的圖像。 – dakab