更新されたフィドルは次のとおりです: FIDDLE。
このCSSで試すことができます:
#log2 {
border: 1px solid #ccc;
border-radius: 3px;
width: 300px;
padding: 10px;
margin: 15px auto 0;
position: relative;
background: #fff;
}
#log2:after {
content: "";
display: block;
position: absolute;
border-style: solid;
border-color: #ccc;
border-width: 1px 0 0 1px;
width: 15px;
height: 15px;
top: -9px;
right: 19px;
background: inherit;
-webkit-transform: rotate(45deg);
-moz-transform: rotate(45deg);
-o-transform: rotate(45deg);
transform: rotate(45deg);
}
ただし、これにはtransform
新しい機能であるプロパティが含まれており、すべてのブラウザで機能するとは限りません。他の解決策は問題ありませんが、この小さな三角形に境界線を追加することはできません. あなたはあなたに合ったものを選びます。
編集:
さらに別のフィドル: http://jsfiddle.net/dAdry/22/。なしでこれを行う方法
も考え出しました。2 つの三角形を配置します。1 つは灰色で、もう 1 つは白です。transform
#log2 {
border: 1px solid #ccc;
border-radius: 3px;
width: 300px;
padding: 10px;
margin: 15px auto 0;
position: relative;
background: #fff;
}
#log2::before, #log2::after {
content: "";
display: block;
position: absolute;
border-style: solid;
border-width: 0 10px 10px 10px;
right: 19px;
}
#log2::before {
border-color: #ccc transparent;
top: -10px;
right: 19px;
}
#log2::after {
content: "";
display: block;
position: absolute;
border-style: solid;
border-color: #fff transparent;
border-width: 0 10px 10px 10px;
top: -9px;
}
それを試してみて、それがあなたに合っているかどうか教えてください.