html - 在宽屏幕上显示标题及其下方的段落无法正常工作
问题描述
我有以下代码,它使用 bootstrap 4.0 来显示<h1>
以下 a <p>
,如下所示:-
<div row style="display:none" id="hideshow" class=" row justify-content-center">
<h1 style="color:#4d9b84 ;font-weight: 700;font-size:25px;margin-top: 15px; ">**********</h1>
<p style="color: #96999b; font-weight: 700; font-size: 100%; margin-bottom: 0px; margin-top: 15px; ">********</p>
</div>
现在在我的 14 英寸屏幕上,我会得到这个正确的布局,下面的标题是:-
在 17 英寸或更宽的屏幕上,我会得到这个布局,它旁边的标题是:-
所以有人可以建议吗?为什么 17 英寸屏幕内的布局被破坏了?
解决方案
试试这个
.myDiv {
display: flex;
flex-direction: column;
}
<div class="myDiv">
<h1>h1**********</h1>
<p>p************</p>
</div>
推荐阅读
- kubernetes - 了解 Kubernetes 网络,具有相同 ip 的 pod
- c - 为什么我的计算字符串长度的函数返回负值?
- rest - REST 最佳实践云
- react-native - 有没有办法知道(通过代码)用户是否在应用程序中并立即使用它?
- azure - 无法从我的逻辑应用中获取 Azure Active Directory 组
- java - 在 Ubuntu 命令行上运行 spring 工具套件(Windows 子系统 Linux)
- regex - 正则表达式检查特定字符的字符串
- java - 如何在不同的活动中将编辑文本值设置为空?
- c# - 为什么“后台位置更新”只有在应用重启后才开始工作?
- opencv - 有没有办法使用 Telepot 直接发送 OpenCV 帧?