html - Text stays out of the box
问题描述
I have two other boxes with the same code and the text stays inside but in the last box the text stays outside, if anybody could help.
HTML:
<div class="third">
<div class="brooo">
<img src="brooo.png" height="200" width="200" style="border: 1px solid black; margin-top: 20px; margin-left: 30px; box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);">
</div>
<div class="thirdd">
<p>BUSINESSES</p><br>
<p>Buy mega companies or small business such as gas stations, clothing stores, bars and more... <br><br>
Employment rankings from 1 man jobs(taxi/gas station) to multi-level "businesses" that require CEO, VP(lieutenants), and standard employees. <br><br>
Do you have what it takes to run a company that supplies the city with common commodities?</p>
</div>
CSS:
.third {
margin-top: 30px;
background-color: #2F3030;
border: 1px solid grey;
height: 250px;
}
.thirdd {
color:rgb(255, 255, 255);
}
解决方案
你的third
div 有这个属性:height: 250px
.
容纳它所有的孩子是非常小的。
删除此属性,父 div 将扩展以包含它的子级。
推荐阅读
- azure - 如果 SAS 令牌到期,将发出警报
- html - 即使我使用引导程序,导航栏元素也不会出现在单行中
- python-3.x - 根据条件更新两个数据框列
- android - 如何匹配存储在 Firebase 安全规则内用于 Firestore 的文档字段中的用户 uid
- android - 无法在 android 设备上运行本机应用程序
- java - Android Room 数据库创建了 3 个文件,包括 -shm 和 -wal 文件
- sql - 如何找到所有具有 CHAR 数据类型的列并在其中具有数值的表?
- javascript - 在 textarea 中发现受限字词时不提交表单
- bash - 使用 grep 打印不匹配的模式而不是文件的不匹配内容
- sql - 计算Oracle SQL中单独行中总和的分布