gpt4 book ai didi

html - 内容被父 div 截断

转载 作者:行者123 更新时间:2023-11-28 06:10:50 25 4
gpt4 key购买 nike

右侧的图像被应用了 overflow:hidden 的父 div 截断。也许这甚至不可能是我如何设置的,但如果是这样,我怎样才能使图像不被切断? https://jsfiddle.net/kimwild/q3vwthky/2/

figure#main-img,
figure#main-img-black {
width: 100%;
overflow: hidden;
}
figure#main-img-black {
background-color: #000000;
}
section#title {
margin: 10px auto;
padding: 0 .83333%;
/* 10px / 1200px */
max-width: 1200px;
-moz-box-sizing: border-box;
-webkit-box-sizing: border-box;
-ms-box-sizing: border-box;
box-sizing: border-box;
overflow: hidden;
}
section#title #hgroup {
float: left;
width: 100%;
z-index: 9020;
position: relative;
}
.parent {} figure#main-img img,
figure#main-img-black img {
/* max-width: 1400px;*/
max-width: 500px;
width: 100%;
right: 0;
top: 0;
position: absolute;
z-index: -1;
}
section#title h1.white,
section#title h1.black {
font-size: 4em;
line-height: 1em;
width: 60%;
padding: 0;
}
section#title h1.white {
color: #FFFFFF;
}
section#title h2.white,
section#title h2.black {
color: #FFFFFF;
font-size: 2em;
line-height: 1.2em;
font-weight: normal;
margin-top: 10px;
width: 40%;
}
section#title h2.white {
color: #FFFFFF;
}
<figure id="main-img-black">
<section id="title">
<div id="hgroup">
<div class="parent">
<img src="http://hauppauge.com/responsive/pics/hdpvr-rocket_top5.jpg" alt="" />
</div>
<h1 class="white">HD PVR
Rocket </h1>
<h2 class="white">Portable Game Recorder</h2>
</div>
</section>
</figure>

最佳答案

一种方法是将 float: right; 放在 .parent 上,如下所示:

.parent { float :right; }

此外,删除 img 上的绝对位置。

See this fiddle

关于html - 内容被父 div 截断,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36185689/

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