html - 使两条平行线从左右垂直位于内容的中心
问题描述
我面临一个问题,也许不是一个大问题,但我无法弄清楚我该怎么做
我想要double line
介于 divleft (Subtotal)
和right ($200)
.
谁能帮我这个?
我已经尝试过,但我无法使其垂直居中。
附上我希望它的外观的屏幕截图: 在此处输入图像描述
我尝试过的代码片段:
.row{
display: flex;
}
.dividerLine{
display: table-cell;
vertical-align: middle;
text-align: right;
border: 2px solid red;
height: 7px;
}
<!DOCTYPE html>
<html lang="en">
<head>
<title>Bootstrap Example</title>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/css/bootstrap.min.css">
<script src="https://ajax.googleapis.com/ajax/libs/jquery/3.5.1/jquery.min.js"></script>
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.1/js/bootstrap.min.js"></script>
</head>
<body>
<div class="container-fluid">
<div class="row">
<div class="col-3 start-lines">
<p class="order-receipt-label light-label">
<span>Subtotal</span>
</p>
</div>
<div class="col-sm-4 dividerLine" style="background-color:lavenderblush;">
</div>
<div class="col-3 start-lines">
<p class="order-receipt-label light-label">
<span>Subtotal</span>
</p>
</div>
</div>
</div>
</body>
</html>
产品总数,我想在它们之间制作双线附上屏幕截图的外观:
解决方案
您可以通过提供属性并从内部的标签中.row
删除来实现这一点。align-items: center;
margin
p
.start-lines
推荐阅读
- android - 绘制数据前的 Android 错误:Invalid Region.Op - 只允许 INTERSECT 和 DIFFERENCE
- python - Pandas DataFrames If else 条件包含破折号的多列
- javascript - 访问框架 DOM chrome 扩展
- wpf - WPF组合框排序,但最初没有选择条目?
- android - 为 DialogFragment 上的导航栏设置颜色
- r - GenSA 和 SA 为背包问题提供无意义的输出
- python - Django 数据库迁移随着“元”类的添加而停止
- flutter - 如何在颤动中检查用户会话并通过路由?
- javascript - 基于文档查询选择器定义 VAR 不起作用
- javascript - Promise 既解决又拒绝