我如何通过StringBuilder在html中添加图像

时间:2018-09-14 03:43:07

标签: html web stringbuilder

sbuilder.Append("&size=20&mode=Exact&filter=127\">" + "<img src=\"" + 
        Path.Combine(HttpRuntime.AppDomainAppPath, 
        "Images\\free_icons\\Web-Application-Icons-Set\\PNG-16\\Link.png") + 
        "\"  width=18px height=18px /></a><br/>");

它在本地运行,但是当我在Web服务器上发布项目时,图像没有显示。

1 个答案:

答案 0 :(得分:0)

\\替换图像路径中的/

此外,widthheight属性接受不带px的数值。