css - Refer static images or fonts in stylesheet when developing extensions for Chrome -
i creating google chrome extension. , want use background-image
attribute of elements define through css. not sure how url()
should given. tried relative url, tries fetch image relative site's domain! not relative extension's source directory.
the stylesheet included extension via manifest file follows:
... "content_scripts": [ { "matches": ["http://www.myblahblahsite.com/"], "js": ["core.js"], "css":["styles.css"] } ], ...
also, same custom fonts using @font-face
for example:
@font-face { font-family: 'abccustom'; src: url("fonts/abccustom.ttf") format('ttf'); }
this won't consider font's path relative extension!
any ideas or suggestions? thanks.
you need make absolute url extension, best way this:
@font-face{ font-family: 'abccustom'; src: url('chrome-extension://__msg_@@extension_id__/fonts/abccustom.ttf') format('ttf'); }
this part of i18n
api.
Comments
Post a Comment