html - 并排的两个内容块
问题描述
我想在网站上写一些内容并在其旁边放置一个表格,如下例所示。
这是我正在使用的代码:
<div id="wrapper">
<div id="block1">
<h3>Your body is a temple.</h3>
Schedule an appointment now and start living a better life.
You deserve it.
</div>
<div id="block2">
<em>*Please include correct contact information so we can get back to you.</em>
[contact-form-7 id="28921" title="Make an appointment"]
</div>
</div>
CSS:
#wrapper {
width:1000px;
}
#block1 {
float: left;
width:500px;
}
#block2 {
float: left;
width:500px;
}
不幸的是,它显示不正确:
我已经尝试了在 stackoverflow 上找到的其他几种方法,但我似乎无法让它工作。这是现场网站,以防万一:orlandochiropractic.org。你必须去写着“需要帮助?”的地带。并点击“预约”按钮。
任何帮助将不胜感激。谢谢!
解决方案
.wrapper {
display: flex;
flex-direction: row;
align-items: center;
justify-content: center;
}
.block {
flex: 1;
padding: 20px;
}
<div class="wrapper">
<div class="block">
<h3>Your body is a temple.</h3>
<p>Schedule an appointment now and start living a better life.
You deserve it.</p>
</div>
<div class="block">
<em>*Please include correct contact information so we can get back to you.</em>
<div>[contact-form-7 id="28921" title="Make an appointment"]</div>
</div>
</div>
推荐阅读
- javascript - 尝试使用 javascript 为不和谐的机器人嵌入超链接
- azure-data-lake - 尝试在 Azure Synapse 中的链接存储上读取 parcquet 文件
- python - 如何告诉 ccxt 使用 binance / bybit 测试网
- python - 如何在 Python 中使用 pandas 读取文本文件并拆分数据框的每个字符/字母
- ios - 尝试关闭加载视图时应用程序崩溃
- ios - 为什么我的背景保持静态黑色?
- python - 在 pycharm 上加载经过训练的 Tensorflow 保存模型时出错。ValueError:int() 的无效文字,基数为 10:'class_name'
- python - 从python中的另一个函数调用main是否错误
- swiftui - SwiftUI 在移动/动画视图/形状上拖放
- javascript - 使用 react-select 时 XHR 错误加载 traceur.js