2013-08-04 69 views
0

我在網站上看到了驚人的邊框效果,我想知道效果如何達到最佳效果。它的導航項目之間的分隔符在垂直列表:這個邊界效果如何在CSS中達到最佳效果?

Border effect

我會選擇基於跨瀏覽器了兼容性最好的答案(和非哈克越好)。

+0

你們是不是隻是做行了,或者你想中間的白色光暈效果呢? – dezman

+0

當然的發光效果。 – Basaa

+0

如果你想要的東西是完全兼容的,你將需要使用一個圖像...但它可以用css完成,只是現在想出來...... – dezman

回答

2

Here you go

您可能必須與它取決於你想要什麼亂七八糟的把你內心的名單!如果你想改變發光的顏色,你可以改變漸變中的顏色。 This is a nice generator, which you probably already knew about.

HTML:

<ul> 
    <li></li> 
    <li></li> 
    <li></li> 
    <li></li> 
</ul> 

CSS:

ul { 
    list-style: none; 
    width: 200px; 
} 
li { 
    background: rgb(30,30,30); 
    text-align: center; 
    height: 40px; 
    color: rgb(140,140,140); 
    border-bottom: 1px solid black; 
} 
li:after { 
    content: ''; 
    display: block; 
    position: relative; 
    top: 41px; 
    height: 1px; 
    background: #1e1e1e; /* Old browsers */ 
    background: -moz-linear-gradient(left, #1e1e1e 0%, #757575 50%, #1e1e1e 100%); /* FF3.6+ */ 
    background: -webkit-gradient(linear, left top, right top, color-stop(0%,#1e1e1e), color-stop(50%,#757575), color-stop(100%,#1e1e1e)); /* Chrome,Safari4+ */ 
    background: -webkit-linear-gradient(left, #1e1e1e 0%,#757575 50%,#1e1e1e 100%); /* Chrome10+,Safari5.1+ */ 
    background: -o-linear-gradient(left, #1e1e1e 0%,#757575 50%,#1e1e1e 100%); /* Opera 11.10+ */ 
    background: -ms-linear-gradient(left, #1e1e1e 0%,#757575 50%,#1e1e1e 100%); /* IE10+ */ 
    background: linear-gradient(to right, #1e1e1e 0%,#757575 50%,#1e1e1e 100%); /* W3C */ 
    filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#1e1e1e', endColorstr='#1e1e1e',GradientType=1); /* IE6-9 */ 
} 
+0

工程很棒。謝謝。 – Basaa