![Firefox html 外部 css 不起作用](https://linux22.com/image/866431/Firefox%20html%20%E5%A4%96%E9%83%A8%20css%20%E4%B8%8D%E8%B5%B7%E4%BD%9C%E7%94%A8.png)
我正在使用 gedit 创建一个网站。当我从文件资源管理器执行 html 文件时,除了内联 css 之外,外部 css 似乎不起作用。这是什么问题?有人能解释如何修复它吗?
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<link href="styles.css" rel="stylesheet" type="text/css"/>
<link href="favicon.ico" rel="shortcut icon" />
<meta name="viewport" content="width=device-width">
<title>Home </title>
</head>
<body id="back">
<div id="Head">
<left><img src="Logo.png" style="float: left; padding-left: 20px;"/></left>
<h1> Sri Krishna Lending Library </h1>
<p align="justify"><a href="index.html">Home </a> <a href="about.html">About us </a> <a href="books.html">Our Books </a> <a href="contact.html"> Contacts & Timings</a> <a href="http://goo.gl/forms/B5kLAzPAhy"> Library Reviews</a> <a href="article.html"> Author of the Month </a></p>
<br>
<br>
<br>
<br>
<br>
<br>
</div>
<div id="Page">
<h2 align="center"> Welcome to Sri Krishna Lending Library's official website. </h2>
<p align="center"> We are a library at Aziz Nagar 2nd street, Near Railway Border Road, Kodambakkam, chennai - 600 024 </p>
<center> <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=false"></script><div style="overflow:hidden;height:500px;width:600px;"><div id="gmap_canvas" style="height:500px;width:600px;"></div><style>#gmap_canvas img{max-width:none!important;background:none!important}</style><a class="google-map-code" href="http://www.trivoo.net/google-maps/" id="get-map-data">www.trivoo.net</a></div><script type="text/javascript"> function init_map(){var myOptions = {zoom:21,center:new google.maps.LatLng(13.047368339315124,80.22979016214481),mapTypeId: google.maps.MapTypeId.ROADMAP};map = new google.maps.Map(document.getElementById("gmap_canvas"), myOptions);marker = new google.maps.Marker({map: map,position: new google.maps.LatLng(13.047368339315124, 80.22979016214481)});infowindow = new google.maps.InfoWindow({content:"<b>Sri Krishna Lending Library</b><br/>aziz nagar 2nd street<br/>600 024 Chennai" });google.maps.event.addListener(marker, "click", function(){infowindow.open(map,marker);});infowindow.open(map,marker);}google.maps.event.addDomListener(window, 'load', init_map);</script></center>
<br>
</div>
<br>
<div id="Footer">
<p> Don't Forget to visit us! </p>
<br>
</div>
</body>
</html>
答案1
这是一个权限问题,因为该文件位于由 root 安装的 NTFS 分区中。
(管理员root
) 挂载了您的 ntfs 分区,styles.css
位于 NTFS 分区中,因此该文件styles.css
属于 root。
创建一个名为 的新文件,style.css
将内容从 复制styles.css
到您新创建的style.css
。删除/移除文件styles.css
。然后将 重命名style.css
为styles.css
。然后它应该可以再次工作!