例如,要创建流指示符,如下所示:
Step 1 > Step 2 > Step 3我可以:
1.使用html+css
.concave{
border-left:1em solid transparent;
border-top:1em solid orange;
border-bottom:1em solid orange;
}
.middle{
background-color:orange;
}
.convex{
border-left:1em solid orange;
border-top:1em solid transparent;
border-bottom:1em solid transparent;
}
<table cellspacing="0" cellpadding="0" border="0" style="font-size:30px;">
<tr>
<td class="concave"/>
<td class="middle" style="width:25%;">Step 1</td>
<td style="max-width:0.5em;"><div class="convex"/></td>
</tr>
</table>2.创建背景图像:

我的问题是,如果html+css或图像可以达到我想要的装饰,我应该使用哪一个?
发布于 2018-06-19 13:31:09
这两种方法都是正确的,因为您首先需要使用语义HTML。因此,如果您有“步骤1”和“步骤2”,则确实有一个有序列表。从这个开始,并为屏幕媒体设置它的样式。使用背景图像,因为它们没有增加语义意义。
如果需要为打印媒体格式化它,请添加打印样式表。
发布于 2018-06-19 12:21:31
发布于 2018-06-19 13:07:45
这两种方法产生的结果并不相同。
例如:
您的css缩放成一个向量到一个点,但随后中断。您可以使用css媒体类型来更改其在不同显示上的外观,但并不是所有浏览器都支持它。
您的图像缩放为光栅,使用更多的带宽下载,但具有更好的兼容性。
在选择对任何给定问题的最佳解决方案之前,您需要有一些需求。但总的来说,我认为网站的优先次序是:
图像一般做得很好,但如果你有太多的图片,它可能会掉到3上。
我认为对于你的小图像来说,带宽是微不足道的,它可能被放置在一个图像映射中,以进一步提高性能。
https://softwareengineering.stackexchange.com/questions/372783
复制相似问题