Add external CSS file to blogger template

两盒软妹~` 提交于 2021-01-19 05:36:40

问题


In the HTML code of my blogger template I am trying to add an external link to a CSS file hosted in Google drive.

I have made the CSS file public and created a direct download link:

https://drive.google.com/uc?export=download&id=0ByXCg9N1QXp8ZWdEWHlIUjMyRDQ

What I did next is that from the blogger admin panel I selected the HTML code of my template using:

Theme -> Edit HTML

and in the <head> section I added the following line:

<link href='//drive.google.com/uc?export=download&id=0ByXCg9N1QXp8ZWdEWHlIUjMyRDQ' 
      rel='stylesheet' media='all' type='text/css'/>

When trying to do Save Theme I get the following error:

Error parsing XML, line 9, column 53: The reference to entity "id" must end with the ';' delimiter.

Apparently the XML parser of the theme code doesn't like the href attribute value. How can I rewrite the url so that it is accepted by the XML parser?


回答1:


The problem is with the & symbol in the link. You will need to replace it with &amp; to make the link be accepted by Blogger's XML parser -

<link href='//drive.google.com/uc?export=download&amp;id=0ByXCg9N1QXp8ZWdEWHlIUjMyRDQ' 
  rel='stylesheet' media='all' type='text/css'/>


来源:https://stackoverflow.com/questions/43675506/add-external-css-file-to-blogger-template

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!