【发布时间】:2021-01-04 18:35:15
【问题描述】:
我在 Servicenow 服务门户上工作,我在其中创建了一个自定义图标链接小部件,该小部件将图像显示为字形图标。
我几乎得到了一切,但与字形图标相比,我的图像的样式保持不变。
/* CIRCLE ICON ---------- */
a.circle_icon {
display: block;
padding: 20px 0px 20px 70px;
position: relative;
}
a.circle_icon .fa {
position:absolute;
left: 0px;
top: 10px;
}
/* Image Circle ------- */
a.image_icon {
display: block;
padding: 20px 0px 20px 70px;
position: relative;
}
a.image_icon .fa {
position:absolute;
left: 0px;
top: 10px;
}
<!--// Circle Icon -->
<a ng-if="::(options.link_template == 'Circle Icon')" ng-href="{{::data.href}}" class="circle_icon {{::options.class_name}} text-{{::options.color}}" target="{{::data.target}}">
<span class="fa fa-stack fa-2x">
<i class="fa fa-circle fa-stack-2x"></i>
<i class="fa fa-{{::options.glyph}} fa-stack-1x fa-inverse"></i>
</span>
<h2>{{::options.title}}</h2>
<span class="text-muted">{{::options.short_description}}</span>
</a>
<!--// Image Icon -->
<a ng-if="::(options.link_template == 'Image Icon')" ng-href="{{::data.href}}" class="image_icon {{::options.class_name}} text-{{::options.color}}" target="{{::data.target}}">
<span class="fa fa-stack fa-2x">
<img src="{{data.target}}"/>
</span>
<h2>{{::options.title}}</h2>
<span class="text-muted">{{::options.short_description}}</span>
</a>
使用此代码,我的输出看起来像这样。 Click here
圆形图标是开箱即用的,图像图标是我的自定义代码。我希望 Aeroplance 图像看起来与上面相同 获取帮助和社区图标。
【问题讨论】:
-
你试过给它同样的课吗?
circle_icon
标签: html css bootstrap-4 servicenow glyphicons