【问题标题】:how to add picture in the background of a CSS triangle [duplicate]如何在CSS三角形的背景中添加图片[重复]
【发布时间】:2015-02-07 02:06:16
【问题描述】:

我已经尝试过,但到目前为止,我已经使用 css 边框 hack 制作了没有任何背景的内容。如何用上图这样的图像推进它?

【问题讨论】:

  • 你不能只检查元素吗?
  • 这个问题之前已经问过了,请参阅 herehere ...
  • 我做了@Justinas,但无法了解图像的放置方式
  • 这个问题不是完全重复的,因为三角形位于其他内容之上,需要查看。我在这里的回答中添加了针对这种情况的解决方案:transparent arrow/triangle

标签: html css css-shapes


【解决方案1】:

您可以使用CSS triangle generator 并修复它。

width: 0;
height: 0;
border-style: solid;
border-width: 0 100px 100px 100px;
border-color: transparent transparent #007bff transparent

另见Creating a transparent arrow above image in CSS3

【讨论】:

    猜你喜欢
    • 2020-02-27
    • 2013-07-16
    • 2014-04-09
    • 2020-03-24
    • 1970-01-01
    • 1970-01-01
    • 2022-01-09
    • 1970-01-01
    相关资源
    最近更新 更多