html - 为什么盒子没有正确对齐?
问题描述
出于某种原因,顶盒在左侧留下了额外的空间,但我不知道为什么。我将衷心感谢您的帮助。
HTML:
<section class="proj-box">
<div class="wrapper">
<div class="thumb" id="Dthumb">
<a href="Dough.html">
<img src="Doughblack.png" alt="screen mockups of Dough app">
</a>
<h3 id="Dtitle">Dough - Your new financial companion</h3>
</div>
<div class="thumb" id="Fthumb">
<a href="Flyte.html">
<img src="flytebig.png" alt="screen mockups of Flyte app">
</a>
<h3 id="Ftitle">Flyte - Flight Search App</h3>
</div>
<div class="thumb" id="Othumb">
<a href="OrderUp.html">
<img src="OrderUpred.png" alt="screen mockups of OrderUp app">
</a>
<h3 id="Otitle">OrderUp - Food Delivery App</h3>
</div>
</div>
</section>
CSS:图片显示黑框未与红框对齐
.proj-box .thumb {
width: 380px;
height: 380px;
float: left;
margin: 20px 20px 0;
}
.proj-box img {
width: 380px;
border: 1px solid #ddd;
border-radius: 4px;
}
.proj-box img:hover {
box-shadow: 0 0 2px 1px #D89E9E;
}
解决方案
你错过了“div”标签
<section class="proj-box">
<div class="wrapper">
<div class="thumb" id="Dthumb">
<a href="Dough.html">
<img src="Doughblack.png" alt="screen mockups of Dough app">
</a>
<h3 id="Dtitle">Dough - Your new financial companion</h3>
</div>
<div class="thumb" id="Fthumb">
<a href="Flyte.html">
<img src="flytebig.png" alt="screen mockups of Flyte app">
</a>
<h3 id="Ftitle">Flyte - Flight Search App</h3>
</div>
<div class="thumb" id="Othumb">
<a href="OrderUp.html">
<img src="OrderUpred.png" alt="screen mockups of OrderUp app">
</a>
<h3 id="Otitle">OrderUp - Food Delivery App</h3>
</div>
</div>
</div>
尝试这个。
推荐阅读
- vba - 在 QueryDefs 中找不到 RecordsetType 属性作为有效属性
- html - 如何在 CSS 中设置默认页面尺寸?
- php - 连接到 AWS RDS 数据库的非 AWS 服务器要慢得多
- swift - UIButton 未添加到子视图 swift
- angular - Angular/TypeScript - 联合类型访问
- python - 如何使用“jupyter-run”在本地调用 jupyter notebook?
- groovy - Groovy:读取然后写入交互式过程
- jmeter - Jmeter-Webdriver 无法在 Chrome 上加载网页
- r - 从闪亮的传单中获取圆圈ID以供以后使用
- android - 30 Hz 的 Android NDK 相机示例 JPEG