为什么我不能让我的外部样式表工作 [英] Why can I not get my external style sheet to work
问题描述
我制作了html和外部CSS表格,我将它们放在同一个文件夹中,但仍然没有任何变化。外部ccs只有
h1 {background-color:red;
{
in it and the that that that I I I h1一个没有红色背景
这两个文件都在一个名为css的折叠中,在我的桌面上都使用相同的路径到目前为止我可以告诉
我尝试过:
I made the html and external CSS sheet and I put them in the same folder but still nothing change. the external ccs just have
h1{background-color:red;
{
in it and that's all I was doing for a test and the h1 one does not have the red background
both files are in a fold called css which is on my desktop both use the same path so far I can tell
What I have tried:
!DOCTYPE html>
<html>
<head>
<style>
div{
float: right;
}
</style>
<title>My List</title>
<link rel="stylesheest" type="text/css" href="css/layout.css">
</head>
<body>
<div>Favorite Movie:John Wick: Chapter2<br><a href="https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&ved=0ahUKEwiYl4j7uLXWAhVm7YMKHVLtCJ4QjRwIBw&url=http%3A%2F%2Fwww.dvdsreleasedates.com%2Fmovies%2F7539%2Fjohn-wick-chapter-2&psig=AFQjCNGLHfIQqcYmmRHGAazWNfG3a9XZPg&ust=1506054644931426"><img src="http://gonewiththetwins.com/new/wp-content/uploads/2017/02/johnwick2.jpg" alt= "John Wick" width="170" height="170">Release Year:2017<br>Stars Keanu Reeves as John Wick himself</a></div>
<h1>My Three Favorite Artist:</h1>
<ul style="color:skyblue;">
<li><a href="https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwin2azjnbXWAhVR92MKHVpcBmEQFggoMAA&url=https%3A%2F%2Fwww.stonesthrow.com%2Fmadvillain&usg=AFQjCNEfMvvaLsP9xedx3mhpP6IU6Wuh0Q">MadVillain</a></li>
<li><a href="https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&cad=rja&uact=8&ved=0ahUKEwjcl5SsnrXWAhVilVQKHTVSA1wQFggoMAA&url=http%3A%2F%2Fwww.flying-lotus.com%2F&usg=AFQjCNEq7iLD_0Yu2j0Bop5kTFcwUUEu2w">Flying Lotus</a></li>
<li><a href="https://www.google.com/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&cad=rja&uact=8&ved=0ahUKEwi6oryLn7XWAhVK-mMKHTKiB90QFgg_MAM&url=https%3A%2F%2Fwww.theatlantic.com%2Fentertainment%2Farchive%2F2010%2F03%2Fnujabes-underground-hip-hop-artist-dead-at-36%2F37755%2F&usg=AFQjCNG3UBjpyn8Z5GZtGf0ZKy_awT8X3w">Nujabes</a></li>
</ul>
<h2>My Favorite Food Are:</h2>
<ol style="color:lime;" type="I">
<li><a href="pizza.html">Pizza</a></li>
<li><a href="Mac and Cheese.html">Mac and Cheese</a></li>
<li><a href="L.html">Lasagna</a></li>
</ol>
<h3>My Dream Vacation Is:</h3>
<ul style="list-style-type:none; color:pink;">
<li>Japan</li>
<li><a href="https://www.google.com/url?sa=i&rct=j&q=&esrc=s&source=images&cd=&ved=0ahUKEwj7nPDrt7XWAhWM7YMKHVQ-AbYQjRwIBw&url=http%3A%2F%2Fen.toureast.com%2Fdestinations%2Fasia%2Fjapan&psig=AFQjCNESScwXDQplLozykZmhPfb0DXcrCA&ust=1506054359795752">
<img src="http://en.toureast.com/portals/0/img/country/japan/japan_header.jpg" alt="Japan" width="400" height="200"></a></li></ul>
<dl style="color:lightseagreen;">
<dt>Japan has all was been a place I really wanted to go yes for the games and the anime I’m a nerd but for that late-night Tokyo city<br>
is something I know I’m going to see one day if I keep moving and don’t slow down or go back.</dt>
</body>
</html>
推荐答案
我制作了html和外部CSS工作表,我将它们放在同一个文件夹中,但仍然没有任何变化。
I made the html and external CSS sheet and I put them in the same folder but still nothing change.
你指向一个名为CSS的子文件夹。
You're pointing to a subfolder called "CSS".
<link rel="stylesheest" type="text/css" href="css/layout.css">
更改为:
Change to:
<link rel="stylesheest" type="text/css" href="./layout.css">
我把它们放在同一个文件夹中但仍然没有变化。
I put them in the same folder but still nothing change.
尝试
try
<link href="layout.css" rel="stylesheet" />
这篇关于为什么我不能让我的外部样式表工作的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!