我正在努力改变这个“右上角”'左上角的指示符'指示符。
.right {
position: relative;
background: aqua;
text-align: right;
min-width: 45%;
padding: 10px 15px;
border-radius: 6px;
border: 1px solid #ccc;
float: right;
right: 20px;
}
.right::before {
content: '';
position: absolute;
visibility: visible;
top: -1px;
right: -10px;
border: 10px solid transparent;
border-top: 10px solid #ccc;
}
.right::after {
content: '';
position: absolute;
visibility: visible;
top: 0px;
right: -8px;
border: 10px solid transparent;
border-top: 10px solid aqua;
clear: both;
}

<div class="right">
<span>thanks</span>
</div>
&#13;
我试图改变'对'&#39;离开&#39;离开&#39;在css。但是没有运气。
答案 0 :(得分:3)
只需在选择器之前和之后从右向左更改。
.right {
position: relative;
background: aqua;
text-align: right;
min-width: 45%;
padding: 10px 15px;
border-radius: 6px;
border: 1px solid #ccc;
float: right;
right: 20px;
}
.right::before {
content: '';
position: absolute;
visibility: visible;
top: -1px;
left: -10px;
border: 10px solid transparent;
border-top: 10px solid #ccc;
}
.right::after {
content: '';
position: absolute;
visibility: visible;
top: 0px;
left: -8px;
border: 10px solid transparent;
border-top: 10px solid aqua;
clear: both;
}
<div class="right">
<span>thanks</span>
</div>
答案 1 :(得分:1)
简单,只需用right
替换left
的所有实例?
.left {
position: relative;
background: aqua;
text-align: left;
min-width: 45%;
padding: 10px 15px;
border-radius: 6px;
border: 1px solid #ccc;
float: left;
left: 20px;
}
.left::before {
content: '';
position: absolute;
visibility: visible;
top: -1px;
left: -10px;
border: 10px solid transparent;
border-top: 10px solid #ccc;
}
.left::after {
content: '';
position: absolute;
visibility: visible;
top: 0px;
left: -8px;
border: 10px solid transparent;
border-top: 10px solid aqua;
clear: both;
}
<div class="left">
<span>thanks</span>
</div>