2012-07-23 89 views
1

CSS:修改CSS泡沫

.container { 
    margin-left: 15px; 
    width: 10px; 
    background: #FFFFFF; 
    border: 1px solid #CAD5E0; 
    padding: 4px; 
    position: relative; 
    min-height: 10px; 
    font-size:8px; 
} 
.container:before { 
    content: ''; 
    display: block; 
    position: absolute; 
    top: 1px; 
    left: 100%; 
    width: 0; 
    height: 0; 
    border-color: transparent transparent transparent #CAD5E0; 
    border-style: solid; 
    border-width: 6px; 
} 

HTML:

<a class="container">1</a>​ 

有人能向我解释如何CSS应该以指针(三角形)的地方进行修改盒子的左侧。

我有它在此琴:http://jsfiddle.net/DTZwA/

+2

[你有什么试过](http://whathaveyoutried.com/)? – 2012-07-23 16:47:08

+0

看左边的位置和边框颜色线。 – sachleen 2012-07-23 16:48:09

回答

5

只需更新这两行:

.container:before { 
    right: 100%; 
    border-color: transparent #CAD5E0 transparent transparent; 
    /* All other properties are identical */ 
} 

这里的小提琴:http://jsfiddle.net/YnD6C/

+0

很高兴解释为什么,我附上了一个赞扬你的答案。 – Eirinn 2012-07-23 16:57:36

+0

如果OP至少会显示[他尝试过的](http://whathaveyoutried.com/),我会进入解释模式。既然他没有,我不知道他做什么或不知道... – 2012-07-23 16:58:45

0

我做了一个插件,这将使泡沫为你:)

当你制作箭头时,你必须考虑对立面。

将颜色值添加到您希望的颜色值的相反侧。

想让它向左走吗?把颜色放在正确的位置上。

http://www.rosefalk.dk/library/base/index.html