我有一个包含如下数据的CSS文件:
@font-face{font-family:"AkzidenzGroteskBE-Bold";font-weight: bold; font-style: normal;src:url(/AkzidenzGroteskBE-Bold.otf);}
@font-face{font-family:"AkzidenzGroteskBE-Regular";font-weight: normal; font-style: normal;src:url(/AkzidenzGroteskBE-Regular.otf);}
@font-face{font-family:"AmericanTypewriterStd-Med";font-weight: normal; font-style: normal;src:url(/AmericanTypewriterStd-Med.otf);}
@font-face{font-family:"AvantGarde Bold";font-weight: bold; font-style: normal;src:url(/AvantGarde-Bold.ttf);}
@font-face{font-family:"FranklinGothicLT-BookCnd";font-weight: normal; font-style: normal;src:url(/FranklinGothicLT-BookCnd.otf);}我想把它做成:
@font-face{font-family:"AkzidenzGroteskBE-Bold";font-weight: bold; font-style: normal;src:url(../Fonts/AkzidenzGroteskBE-Bold.otf);}
@font-face{font-family:"AkzidenzGroteskBE-Regular";font-weight: normal; font-style: normal;src:url(../Fonts/AkzidenzGroteskBE-Regular.otf);}
@font-face{font-family:"AmericanTypewriterStd-Med";font-weight: normal; font-style: normal;src:url(../Fonts/AmericanTypewriterStd-Med.otf);}
@font-face{font-family:"AvantGarde Bold";font-weight: bold; font-style: normal;src:url(../Fonts/AvantGarde-Bold.ttf);}
@font-face{font-family:"FranklinGothicLT-BookCnd";font-weight: normal; font-style: normal;src:url(../Fonts/FranklinGothicLT-BookCnd.otf);}我在每行末尾的引用中添加了../Fonts/。
我尝试读取每一行并使用多个substring来找出(和);}之间的值。
它正变得非常复杂。请提供一个简单的解决方案。
发布于 2019-04-16 16:21:20
检查这是否起作用
YourDiv.Attributes.CssStyle.Add("src", "url(../Fonts/AkzidenzGroteskBE-Bold.otf)");https://stackoverflow.com/questions/55703526
复制相似问题