gpt4 book ai didi

html - Css 位置 Angular 绝对左下角

转载 作者:太空宇宙 更新时间:2023-11-04 16:29:55 24 4
gpt4 key购买 nike

我正在尝试在我的设计中添加一个补充 Angular ,无论该框中内容的大小如何,一个 Angular 都应该位于内容框下方。

如您所见, Angular 适合第二个框,但不适用于第一个框。

这是一个 fiddle http://jsfiddle.net/cnmWh/

此处为 HTML 代码:

<div class="title_container">
<div class="hook_bottom_left"></div>
<div class="title ">
<p >Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting, remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions of Lorem Ipsum.</p></div>
</div>


<div class="title_container">
<div class="hook_bottom_left"></div>
<div class="title ">
<p >Lorem Ipsum is simply dummy text of the printing and typesetting industry. </p>
</div>
</div>

此处的 CSS:

.title_container {position: relative; min-height: 112px; padding-top: 25px; padding-bottom: 5px; display:block;}
.title { position: absolute; background:url("img/hash_light.png"); border: 1px solid #c8c8c8; padding: 15px; z-index: 10;
width: -moz-calc(100% - 16px);
width: -webkit-calc(100% - 16px);
width: -o-calc(100% - 16px);
width: calc(100% - 16px);
margin-top: 8px;
margin-left: 8px;
overflow: hidden; }

.hook_bottom_left{position: absolute; left:0; bottom:17px; border-left: 8px solid #000; border-bottom:8px solid #000; width: 40px;height: 40px;}

最佳答案

看看this JsFiddle

我拿走了 min-height,将文本设为 position:relative; 并设为 bottom:0

如果钩子(Hook)小于 122pxmin-height 将不会让钩子(Hook)到达底部,这就是为什么它在打开时“悬挂”在它下面的原因bottom:0;.

文本是 position:absolute 这意味着它们没有占用任何宽度(导致各种重叠错误)。只要它们是position:relative,钩子(Hook)就可以获得正确的高度。


JsFiddle with :before element

这个带走了

<div class="hook_bottom_left"></div>

而是在 .title_container 上使用 :before 插入“钩子(Hook)”。

这意味着您不再需要使用 div 作为 Hook ,.title_container 类将自动拥有它。

关于html - Css 位置 Angular 绝对左下角,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/22687004/

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