gpt4 book ai didi

html - 隐藏的溢出使 img 下降并被剪裁

转载 作者:行者123 更新时间:2023-11-28 08:02:22 25 4
gpt4 key购买 nike

我正在尝试编码 this page .

我不知道如何解决这个问题,但似乎 #bigfoverflow:hidden 使图像下降并被裁剪。如何使 #bigf 中的所有这些 div 很好地适合一条水平线?谢谢。

HTML:

<html>
<head>
<title>Title</title>
<meta name="Description" content="desc">
<meta name="keywords" content="keywords">
<meta http-equiv="Content-type" content="text/html; charset=ISO-8859-2" />
<link type="text/css" href="style.css" rel="stylesheet" />
<link href='http://fonts.googleapis.com/css?family=Exo+2' rel='stylesheet' type='text/css'>
</head>

<body>

<div id="wrap">

<div id="top">
<div class="container">
<h1>Name</h1>
</div>
</div>

<div id="bigf">
<div class="container">
<img src="hydraulik.png" class="hydra">

<div class="sm1">
<div class="textsec">SOMETHING</div>
<div class="textsec">IS SAID HERE</div>
</div>


</div>
</div>

</div>

</body>

</html>

CSS:

* {
margin:0px;
padding:0px;
}

body {
font-family: 'Exo 2', sans-serif;
}

#wrap {
position: relative;
width: 100%;
overflow: hidden;
background: #fff;
}

#top {
height:60px;
}

.container {
width:1160px;
margin:0 auto;
}

#bigf {
height:380px;
background: url(bf.jpg) right no-repeat black;
overflow:hidden;
}

.textsec {
background: none repeat scroll 0% 0% rgba(0, 0, 0, 0.8);
display: inline-block;
color: #FFF;
font-weight: 600;
padding: 10px 25px;
outline: 2px solid rgba(51, 51, 51, 0.2);
text-shadow: 2px 3px 0px #000;
margin: 0px 0px 10px;
float:right;
font-size:26px;
}

.hydra {
margin-left:25px;
float:left;
}

.sm1 {
margin-top:150px;
}

最佳答案

clearfix 添加到 #bigf .container

.cf:before,
.cf:after {
content: " "; /* 1 */
display: table; /* 2 */
}

.cf:after {
clear: both;
}

并将该类添加到容器中。

<div class="container cf"></div>

里面有 float 元素,所以我建议你阅读以下内容:What is Clearfix

关于html - 隐藏的溢出使 img 下降并被剪裁,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29671224/

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