【发布时间】:2019-07-07 15:17:06
【问题描述】:
我正在尝试在电子邮件中使用 css 边框生成一个三角形,并在其中放入一些动态文本(数字),但我想将其设置为三角形中心,但我无法使用定位,因为它已从内联css
我尝试将三角形 css 的 div 和文本跨度放在 div 容器中并使用位置对齐 - 没有用
<div style="<%= MailComponents.create_style('display' => 'inline-block', 'width' => '2px', 'height' => '0px', 'border-radius' => '4px' ,'border-left' => '20px solid transparent', 'border-right' => '20px solid transparent' ,'border-bottom => '30px solid #FC577A', 'color' => '#fff', 'vertical-align' => 'middle', 'line-height' => '28px', 'margin-top' => '-10px') %>">
<span style="<%= MailComponents.create_style('position' => 'relative', 'left' => '-8px','vertical-align' => 'middle', ) %>">
<%= some dynamically generated number %>
</span>
</div>
试过这个技巧
http://jsfiddle.net/VScFS/57/
没有帮助 我想知道这是否可以用表格来完成
【问题讨论】:
标签: css email border css-shapes text-alignment