开发者

CSS not loading in Chrome and Safari..works in Firefox and IE

开发者 https://www.devze.com 2023-02-12 03:00 出处:网络
I am giving external csspath in aspx page via <link rel=\"stylesheet\" media=\"all\" href=\"file:///D:/CSS/Style.css\" type=\"text/css\" />

I am giving external css path in aspx page via

<link rel="stylesheet" media="all" href="file:///D:/CSS/Style.css" type="text/css" />

its works fine in firefox and ie while access that 开发者_JS百科page.

but when i open this page in chrome or safari. it does'nt do anything and no css is applying. please tell what wrong i am doing??.


Make a relative path in the href attribute. For example: "~/CSS/Style.css"


Try an alternitive way of linking to the css:

<style type="text/css"><!-- @import url(file:///D:/css/styles.css); --></style>

But also try running a local server rather than using the file system. XXAMP and EasyPHP are good.


Done a bit of reading around, try using "file://" instead of "file:///" in your UNC. Chrome and safari should be able to read this and change it accordingly.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号