gpt4 book ai didi

css - 定义 css 箭头的度数

转载 作者:太空宇宙 更新时间:2023-11-04 13:23:31 26 4
gpt4 key购买 nike

我将如何定义用 css 创建的箭头的度数如下

<div class="bubble"></div>

.bubble
{
background: none repeat scroll 0 0 #FF7401;
border: 3px solid silver;
border-radius: 25px;
bottom: 18px;
float: right;
height: 63px;
margin-right: 10px;
padding: 0;
position: relative;
width: 250px;
}

.bubble:after
{
content: '';
position: absolute;
border-style: solid;
border-width: 29px 16px 0;
border-color: #ff7401 transparent;
display: block;
width: 0;
z-index: 1;
bottom: -29px;
left: 47px;
}

.bubble:before
{
content: '';
position: absolute;
border-style: solid;
border-width: 31px 18px 0;
border-color: silver transparent;
display: block;
width: 0;
z-index: 0;
bottom: -34px;
left: 45px;
}

div.bubble p {
color: #FFFFFF;
font-size: 21px;
font-weight: bold;
margin-top: 10px;
text-align: center;
}

http://jsfiddle.net/lgtsfiddler/GpUpZ/1/

我想要的是箭头的右边缘 right 应该更长并且不等于左边缘。特别是,左边缘应垂直于文本气泡,而右边缘应与它相交。为了更好地可视化,这里是我正在努力实现的示例:

enter image description here

最佳答案

像这样修改你的css

.bubble:before
{
content: '';
position: absolute;
border-style: solid;
border-width: 33px 18px 0; // modify this line
border-color: silver transparent;
/* display: block; */ // remove this line
width: 0;
z-index: 0;
bottom: -27px; // modify this line
left: 50px;
-webkit-transform: rotate(-108deg) skew(11deg,-10deg); // modify this line
}

Demo

关于css - 定义 css 箭头的度数,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/23888328/

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