尝试构建网页。和相关的 CSS 链接不会工作。只能直接链接。
头:
<link href="http://directorym.net/App_Themes/customDarkBlueWAdSense_en-US/customDarkBlueWAdSense_en-US.css" type="text/css" rel="stylesheet" />
<link rel="stylesheet" type="text/css" href="http://pboo.mobi/corey/articles_media/dmNet.css" />
<link rel="stylesheet" type="text/css" href="http://pboo.mobi/corey/App_Themes/mobile.css" />
当我将其设为相对时:
<link rel="stylesheet" type="text/css" href="articles_media/dmNet.css" />
<link rel="stylesheet" type="text/css" href="App_Themes/mobile.css" />
它不会出现。
建议?
最佳答案
使用绝对路径:
<link rel="stylesheet" type="text/css" href="/corey/articles_media/dmNet.css" />
<link rel="stylesheet" type="text/css" href="/corey/App_Themes/mobile.css" />
关于html - CSS 仅适用于直接链接,为什么相对不起作用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7176251/