【发布时间】:2021-04-13 19:26:39
【问题描述】:
我正在使用 Bootstrap 4。这是我的网页在大屏幕上的样子:
如何更改我的代码,以使“Lorem Ipsum”字样不会显示在中等屏幕和较小尺寸的屏幕上?
另外,在小尺寸屏幕上,如何更改我的代码以使文本“Carlos Qiano”在顶部和底部具有相等的间距:
这是我需要修改的 HTML 和 CSS 代码:
<!DOCTYPE html>
<html>
<head>
<title>Background Image</title>
<meta charset="utf-8"></meta>
<meta name="viewport" content="width=device-width, initial-scale=1" ></meta>
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/css/bootstrap.min.css" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
</head>
<style type="text/css">
/*body{
margin-top: 53px;
}*/
.jumbotron {
background-image: url("background1.jpg");
text-align: center;
height:522px;
background-size: cover;
}
</style>
<body>
<section id="page-top">
<div class="jumbotron">
<p data-aos="zoom-out" data-aos-delay="500" style="font: 120px Verdana,sans-serif; margin-top: 35px; color: black; animation-duration: 2s; animation-iteration-count:infinite; animation-delay: 1s;" class="lead pulse mb-5 green pb-5 aos-init aos-animate">Carlos Qiano</p>
<p data-aos="zoom-out" data-aos-delay="500" style="font: 20px Georgia,serif;font-style:italic; line-height: 1.6; color:black;animation-duration:2s;animation-iteration-count:infinite; animation-delay:1s;" class="lead pulse mb-5 lightGreen pb-5 aos-init aos-animate d-none d-md-block">Lorem Ipsum.<br>Lorem Ipsum.</p>
</div>
</section>
</body>
</html>
【问题讨论】:
-
您可以使用@media 查询来更改内容在不同设备上的外观,或使用响应式像素作为字体。
标签: html css bootstrap-4 responsive-design frontend