html - 使 img 仅出现在 Jumbotron div 中
问题描述
我是引导程序的新手,我想知道为什么图像与 jumbotron 重叠,我只需要图像留在 Jumbotron 类中。这是图像: 图像与 Jumbotron 类重叠
这是代码:
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>Coffee Cafe</title>
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" type="text/css" media="screen" href="main.css" />
<script src="main.js"></script>
<link rel="stylesheet" type="text/css" href="bootstrap.css">
<link rel="icon" href="Images/Free-Coffee-Logo-1-999x999.png">
</head>
<body>
<div>
<nav class="navbar navbar-expand-lg navbar-light bg-light" >
<a class="navbar-brand active" href="#">
<img src="Images/Free-Coffee-Logo-1-999x999.png" width="30" height="30" class="d-inline-block align-top" alt="">
Insta Coffee
</a>
<ul class="nav navbar-nav ml-auto">
<li class="nav-item"><a class="nav-link" href="#">Who We Are</a></li>
<li class="nav-item"><a class="nav-link" href="#">What We Do</a></li>
<li class="nav-item"><a class="nav-link" href="#">Contact Us</a></li>
</ul>
</nav>
</div>
<div class="jumbotron text-center">
<img class=" rounded float-left" src="Images/pexels-photo-437716.jpeg" alt="Coffee for front page">
<div class="page-header">
<h1>The More You Sip, the More You'll Love</h1>
</div>
<p>Lifes pleasurable moments is just one sip away!</p>
</div>
<div>
<p class="text-center">Who We Are</p>
<p>
We are a team of coffee makers dedicated to give you the best coffee.
Our team composes of people with 10 years of experience making coffee
</p>
</div>
<div>
<p class="text-center">What We Do</p>
<p>
We specialize with some of the most popular coffee in the market such as:
</p>
<ul>
<li>Caffè Americano</li>
<li>Café Latte</li>
<li>Cappuccino</li>
<li>Espresso</li>
<li>Flat White</li>
<li>Flat White</li>
</ul>
</div>
<div>
<p class="text-center">Contact Us</p>
</div>
</body>
</html>
另外,我打算做一个类似这个主题的网站:https ://blackrockdigital.github.io/startbootstrap-freelancer/
在这个主题中,请注意 "portfolio" 、 "About" 和 "Contact" 与浏览器的大小相似。
我希望我的“我们是谁”“我们做什么”和“联系我们”是这样的。我应该上什么课?
解决方案
你应该给overflow:hidden到jumbotron类并根据需要管理img的css
推荐阅读
- python - 启动 Jupyter Notebook 时出错:ssl.SSLError: [ASN1] nested asn1 错误
- python - 在python中安装枕头的问题
- python - 您可以继续在列表中添加内容直到某个点吗?
- python - 无法使用 python 从 url 中检索 json 数据
- kdb - 多进程启动脚本 q
- python - python asyncio如何读取StdIn并写入StdOut?
- coq - 非归纳类型的平等
- html - Html : 查看其父 id 之外的 id
- python - PubsubMessage publish_time 被保存为 DatetimeWithNanoseconds
- wso2 - 寻找用于监控流量管理器队列的 WSO2 JMS 参数