jsf - 如何从在深色背景上加载 gif 中删除边框?
问题描述
我正在尝试为我的 Web 应用程序创建一个没有任何边框或背景的加载 gif 对话框。我正在为 JSF 使用 PrimeFaces。我无法删除边框上的阴影。这里的图像和代码:
<html xmlns="http://www.w3.org/1999/xhtml" xmlns:p="http://primefaces.org/ui">
<style>
.loadingPanel .ui-widget-content{
background: transparent !important;
border:none !important;
box-shadow:none !important;
}
</style>
<p:dialog widgetVar="loadingDialog" draggable="false" modal="true" closable="false" resizable="false" showHeader="false" styleClass="loadingPanel">
<p:graphicImage name="images/loading_spinner.gif" library="ecuador-layout" />
</p:dialog>
</html>
解决方案
问题在于 GIF 格式。它不支持 Alpha 通道透明度,因此透明图像的边缘看起来很糟糕(取决于它显示的背景)。
您可以使用 SVG 动画或动画图标代替 GIF 动画,例如使用PrimeIcons:
<i class="pi pi-spin pi-spinner" style="font-size: 3em"></i>
也可以看看:
推荐阅读
- graphql - 如何在 FaunaDB 中使用 REST API?
- sql - 为什么在过滤掉特定值时会丢失 NULL?
- html - 滚动页面时不能使两条垂直线粘在底部
- python - (已关闭)“ValueError: max() arg is an empty sequence”,即使该序列不为空
- javascript - 为什么我的语音识别功能在填写两个输入时会达到最大值?
- flutter - 对颤振中的模型有点困惑
- javascript - 我想得到年、月和日两个日期之间的差异
- python - 使用 numpy 测试误报和误报
- windows - Windows Speech SAPI:如何列出声音的属性?
- c++ - 创建具有操作和数据类型 c++ 的模板