html - 内容不会将大小调整为 pagewrapper
问题描述
当我调整浏览器窗口的大小时,我无法弄清楚为什么我的标题和标题图像不会调整为在页面包装器内居中。“信息框”类正在调整大小和调整,但 default-img 和 default-heading 不是。
.pageWrapper {
text-align: center;
margin: 15px;
padding: 10px;
border: 1px solid transparent;
border-radius: 10px;
background-color: #e6d5b8;
font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
letter-spacing: 1.5px;
color: #4a3933;
}
.row {
display: flex;
flex-direction: row;
flex-wrap: wrap;
width: 100%;
}
.column {
display: flex;
flex-direction: column;
flex-basis: 100%;
flex: 1;
}
.contentbox {
background: transparent;
padding: 20px 20px 20px 20px;
}
.informationbox {
text-align: left;
padding: 10px;
margin: 5px 0px;
border: 1px solid transparent;
border-radius: 10px;
transition: all 400ms ease-in-out;
}
.default-heading {
font-family:-apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, 'Open Sans', 'Helvetica Neue', sans-serif;
letter-spacing: 1.5px;
color: rgb(184, 13, 50);
}
.default-img {
border:1px solid transparent;
border-radius: 10px;
margin: 0 auto;
}
<body>
<div class="pageWrapper">
<div class="row">
<div class="column contentbox"> <!-- Main image and header left -->
<img src="https://www.lifeinnorway.net/wp-content/uploads/2019/01/learn-norwegian-to-fluency.jpg" class="default-img">
<h1 class="default-heading center">Norwegian Language course</h1>
</div>
<div class="column contentbox"> <!--Displayed information on the right top of the page-->
<div class="informationbox" id="schedule">
<h4> Schedule </h4>
<p> <strong> Please register for more information </strong> </p>
</ul>
</div>
<body/>
解决方案
我一直在通过在 HTML 的标题中输入它来使用它,并且它在我的所有设备上都可以使用
<meta name= "viewport" content="width=device-width, initial-scale=1">
推荐阅读
- c# - 运行命令提示符命令不能在“”中运行命令
- sql-server-2005 - 从 JAVA 8 连接到 SQL Server 2005
- c# - 不计算文本框中的空白
- java - 如何在将 targetSdkVersion 从版本 25 升级到 27 时修复错误?
- python-3.x - Discord Bot 无法访问文本文件
- pointers - 将 D 对象指针转换为 void* 并传递给回调
- ruby-on-rails - 新页面正确获取资源,但编辑页面没有
- javascript - 将确切的数字和字符串与两者中的任何内容匹配
- c# - 如何在类/单独的线程 ASP.Net Core 中使用 ApplicationDbContext
- xml - 使用 Powershell 按列号拆分 CSV 文件