为不规则形状的图像添加边框

时间:2017-12-18 18:22:24

标签: html css image

我正在尝试开发一个公司的团队页面,该页面使用不规则形状的png图像,但需要在图像周围有红色边框。

成品需要如下所示: enter image description here

我给出的图像是这样的: enter image description here

有没有办法使用css / js为图像提供一个边框,该边框保持在不规则形状所在的区域?

已搜索到高低,但无法找到可行的解决方案。

1 个答案:

答案 0 :(得分:4)

您需要使用图片编辑器将白色未使用的空间移除到Alpha通道并将其另存为 .png 文件,然后您可以使用drop阴影应用所需的效果。以下只是一个演示:

Dim qdef as QueryDef

Set qdef = CurrentDb.QueryDefs("mySavedQuery")

qdef![txtreceipt_id_PARAM] = txtreceipt_id
qdef![txttdate_PARAM] = txttdate
qdef![txttotal_cost_PARAM] = txttotal_cost
qdef![txttotal_disc_PARAM] = txttotal_disc

qdef.Execute dbFailOnError

Set qdef = Nothing
img {
  width: 70%;
  filter: drop-shadow(4px 0px 0 red);
}

相关问题