2014-10-03 46 views
0

我試圖創建下面的提示(不中的內容 - 只是盒子&箭頭):CSS只有 - 工具提示使用前向箭頭

enter image description here

我有得到的問題箭頭與主箱子正確混合。

我用迄今爲止的代碼創建了Fiddle here

你會注意到箭頭看起來不錯,但不適合100%,我不知道如何完成它。

下面是箭頭代碼:

.arrow_box:after, .arrow_box:before { 
    border: 11px solid; 
    border-color: inherit; 
    border-left: 11px solid transparent; 
    border-right: 11px solid transparent; 
    position: absolute; 
    content: ''; 
    left: 90%; 
    bottom: 100%; 
} 

.arrow_box:after { 
    border-color: rgba(136, 183, 213, 0); 
    border-bottom-color: #f3f3f3; 
    border-width: 13px; 
    margin-left: -23px; 
} 

.arrow_box:before { 
    border-color: rgba(194, 225, 245, 0); 
    border-bottom-color: #e1e1e1; 
    border-width: 15px; 
    margin-left: -25px; 
} 
+1

最近我回答的問題類似的問題:http://stackoverflow.com/questions/25901148/shadows-on-三邊只有多個插入框陰影和alpha透明/ 25901339#25901339它可能有一些幫助。 – 2014-10-03 03:27:39

回答

1

http://jsfiddle.net/9uppsLqa/5/

.arrow_box { 
    border-radius: .1875em; 
    z-index: 99; 
    position: relative; 
    box-shadow: 0 0 0 1px rgba(0,0,0,0.15),inset 0 0 0 1px rgba(255,255,255,0.6), 0 4px 2px -2px rgba(0,0,0,0.2),0 0 1px 1px rgba(0,0,0,0.15); 
    background-repeat: repeat-x; 
    background-position: 0 0; 
    background-image: linear-gradient(to bottom,rgba(255,255,255,0.7) 0,rgba(255,255,255,0) 100%); 
    background-color: #e1e1e1; 
    margin-top: 3em; 
    margin-left: .75em; 
    margin-right: .75em; 
    padding-left: 0; 
    padding-bottom: 0; 
    padding-right: 0; 
    padding-top: 0; 
    width: 340px; 
    height: 160px; 
} 
.arrow_box:after, .arrow_box:before { 
    border: 13px solid transparent; 
    position: absolute; 
    content: ''; 
    left: 90%; 
    bottom:100%; 
} 

.arrow_box:after { 
    border-bottom-color: #fafafa; 
    border-width: 14px; 
    margin-left: -24px; 
} 

.arrow_box:before { 
    border-bottom-color: #999; 
    border-width: 15px; 
    margin-left: -25px; 
} 
+0

謝謝堆:) – Adam 2014-10-03 04:07:08

+0

np!需要練習。 – 2014-10-03 04:23:02