gpt4 book ai didi

html - CSS修改排列指针

转载 作者:太空宇宙 更新时间:2023-11-03 20:21:35 24 4
gpt4 key购买 nike

我的 html 上有一个 css 工具提示。我在气泡底部看到了箭头标记(bubble:after)。如何重新排列到气泡的右中心?

这是我的div

 <div class="bubble">Hi there. I like turtles.</div>
<p style="margin-left: 1em;">Mikey sez</p>

显示在我的 div 上的气泡来自下面的 css

 <style type="text/css">
.bubble {
position: relative;
background-color:#eee;
margin: 0;
padding:10px;
text-align:center;
width:180px;
-moz-border-radius:10px;
-webkit-border-radius:10px;
-webkit-box-shadow: 0px 0 3px rgba(0,0,0,0.25);
-moz-box-shadow: 0px 0 3px rgba(0,0,0,0.25);
box-shadow: 0px 0 3px rgba(0,0,0,0.25);
}
.bubble:after { //This after mark has to be arranged so to point to the right of bubble
position: absolute; //The position should be at the center
display: block;
content: "";
border-color: #eee transparent transparent transparent;
border-style: solid;
border-width: 10px;
height:0;
width:0;
position:absolute;
bottom:-19px;
left:1em;
}

Bubble with bubble after

重新排列如下图

To be rearranged like this

最佳答案

查看 this jsFiddle .您需要做的就是更改 ::after 元素的绝对定位,并切换具有颜色的边框,从此:

border-color: blue transparent transparent transparent;
bottom:-19px;
left:1em;

对此:

border-color: transparent transparent transparent blue;
bottom:25%;
right:-19px;

关于html - CSS修改排列指针,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/9428509/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com