我正在寻找一种方法来实现 Twitter 在他们的 Messenger 中所做的关于border-radius
. 为了更容易解释,我将首先添加一些照片:
图像border-bottom-left-radius
集:
没有 图像border-bottom-left-radius
:
关于 twitter 如何根据附加的文本消息的宽度动态设置border-radius(在本例中)的任何想法?border-bottom-left-radius
.image {
border-radius: 1.25rem 1.25rem 0 1.25rem;
display: block;
margin-left: auto;
width: 70%;
}
.text {
border-radius: 0 0 0 1.25rem;
float: right;
background-color: rgb(230, 236, 240);
height: 40px;
max-width: 70%;
padding-top: 5px;
}
.divider {
display:block;
margin-top: 80px;
}
<img class="image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Miscanti_Lagoon_near_San_Pedro_de_Atacama_Chile_Luca_Galuzzi_2006.jpg/512px-Miscanti_Lagoon_near_San_Pedro_de_Atacama_Chile_Luca_Galuzzi_2006.jpg" />
<div class="text">
<span>This is the text</span>
</div>
<div class="divider"></div>
<img class="image" src="https://upload.wikimedia.org/wikipedia/commons/thumb/a/a3/Miscanti_Lagoon_near_San_Pedro_de_Atacama_Chile_Luca_Galuzzi_2006.jpg/512px-Miscanti_Lagoon_near_San_Pedro_de_Atacama_Chile_Luca_Galuzzi_2006.jpg" />
<div class="text">
<span>This is just a relatively longer text for the sake of demonstrating this example!!</span>
</div>
慕田峪7331174
相关分类