gpt4 book ai didi

css - L型div容器

转载 作者:技术小花猫 更新时间:2023-10-29 11:05:46 34 4
gpt4 key购买 nike

我正在尝试使用 CSS 绘制以下“L”形 div。

L shaped container div

如何在这个 L 形容器中绘制这个包含文本流的形状?

最佳答案

像这样:

HTML:

<div class="container">
<div class="mask"></div>
<p>Lorem ipsum dolor sit amet, consectetur adipisici elit, sed eiusmod tempor incidunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquid ex ea commodi consequat. Quis aute iure reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint obcaecat cupiditat non proident, sunt in culpa qui officia deserunt mollit anim id est laborum.</p>
</div>

CSS:

.container
{
border: 3px solid black;
}

.mask
{
border-style: solid;
border-width: 0 0 3px 3px;
position: relative;
float: right;
clear: none;
right: -3px;
top: -3px;
background-color: white;
width: 50%;
height: 4em;
}

Demo

关于css - L型div容器,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/20091275/

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