css - 如何创建一个在两侧具有尺寸箭头且尺寸活动区域的 Flexbox
问题描述
我有一个页面可以看到一个盒子。这有 2 个区域,箭头用于输入尺寸。我不熟悉下面的概念,也没有运气将箭头放在我需要的地方。长度等,然后将文本部分居中在中间。很久以前,我从网上某个地方拉了这个,然后又回到了它。有谁知道这件事或我可以去哪里了解更多信息?它也不能很好地与引导程序一起使用。它不会像其他所有内容一样在屏幕上进行调整。我需要它来响应。
.shape {
position: absolute;
margin-left: 30px;
margin-top: 5px;
background: white;
height: 284px;
width: 355px;
text-align: center;
line-height: 230px;
}
.shape-container {
display: block;
position: absolute;
width: 400px;
height: 325px;
background: Gainsboro;
padding: 2px;
}
svg {
width: 284px;
height: 20px;
}
.svgContainer {
position: absolute;
display: inline-block;
text-align: center;
width: 225px;
height: 20px;
}
.svgContainer:after {
content: attr(data-dimention);
display: inline-block;
position: relative;
top: -24px;
padding: 0 8px;
background-color: Gainsboro;
color: #8c8b8b;
font-size: 12px;
line-height: 20px;
}
.svgLeft {
left: -96px;
top: 150px;
transform: rotate(-90deg);
}
.svgBottom {
bottom: 8px;
right: 8px;
}
<div class="shape-container">
<div class="svgContainer svgLeft" data-dimention="30 mm">
<svg>
<marker id="arrow-left" markerHeight="16" markerUnits="strokeWidth" markerWidth="20" orient="auto" refX="3" refY="0" viewBox="0 -5 20 20">
<path d="M 15 -5 L 0 0 L 15 5 z" fill="black" />
</marker>
<marker id="arrow-right" markerHeight="16" markerUnits="strokeWidth" markerWidth="20" orient="auto" refX="-3" refY="0" viewBox="-15 -5 20 20">
<path d="M -15 -5 L 0 0 L -15 5 z" fill="black" />
</marker>
<line id="e3_line" x1="0" y1="10" x2="284" y2="10" stroke="black" style="stroke-width: 1px; fill: none; marker-start: url("#arrow-left"); marker-end: url("#arrow-right");" />
</svg>
</div>
<div class="shape">
shape image
</div>
<div class="svgContainer svgBottom" data-dimention="30 mm">
<svg>
<marker id="arrow-left" markerHeight="16" markerUnits="strokeWidth" markerWidth="20" orient="auto" refX="3" refY="0" viewBox="0 -5 20 20">
<path d="M 15 -5 L 0 0 L 15 5 z" fill="black" />
</marker>
<marker id="arrow-right" markerHeight="16" markerUnits="strokeWidth" markerWidth="20" orient="auto" refX="-3" refY="0" viewBox="-15 -5 20 20">
<path d="M -15 -5 L 0 0 L -15 5 z" fill="black" />
</marker>
<line id="e3_line" x1="0" y1="10" x2="225" y2="10" stroke="black" style="stroke-width: 1px; fill: none; marker-start: url("#arrow-left"); marker-end: url("#arrow-right");" />
</svg>
</div>
</div>
解决方案
推荐阅读
- xml - 通过 HTTP API restful-url 自动发布 XML 有效负载
- python - 如何暂停和恢复 python 脚本
- django - HTML 显示重复的数据库条目
- powershell - 在批处理脚本中从 Powershell 调用 Sharepoint Web 服务的问题
- visual-studio-code - 有没有办法让悬停时显示的定义预览出现在 VSCode 的单独面板中
- mysql - NULL 值的唯一约束
- c# - 在 C# .NET 中使用 Cloud SQL Admin API 从存储桶存储导入 csv 文件时出现 400 错误
- azure-ad-b2c - Azure B2C 页面布局在 2.0.0 之后的版本中缺少翻译
- c++ - 什么时候需要删除指针,什么时候需要将它们设置为 0?
- sql-server - 无法在 SQL Server 中创建表(所有创建的表都在“外部表”中)