下面这段代码中的CSS样式Chrome能显示出来,IE和Firefox均显示不出,这事为什么?
decoration.html:<html><head><linkrel="stylesheet"type="css/text"href="decoration.css"...
decoration.html:
<html>
<head>
<link rel = "stylesheet" type = "css/text" href = "decoration.css" />
</head>
<body>
<table align = "right">
<tr><th>Home</th></tr>
<tr><th>Info</th></tr>
<tr><th>Help</th></tr>
<tr><th>News</th></tr>
</table>
<h1>I <em>love</em> to decorate!</h1>
<p>I think that decorating <span class = "oops">cakes</span> HTML is lots of fun.Here are some of my favorites.
<div class = "text">
<p id = "a">Undelined text(don't you want to click here?)</p>
<p id = "b">Line-through text</p>
<p id = "c">Overlined text</p>
<p id = "d">Blinking text (this is hard to show in print!)</p>
</div>
</body>
</html>
--------------------------------------------------------------------------------
decoration.css
em {
text-decoration :underline ;
}
table {
border :1em solid fuchsia ;
font-weight :bold ;
font-family :ubuntu ;
}
.oops {
text-decoration :line-through ;
}
.text {
padding :2em 1em auto 2em ;
margin :3em 5em auto 1em ;
border :1px solid teal ;
}
#a {
text-decoration :underline ;
}
#b {
text-decoration :line-through ;
}
#c {
text-decoration :overline ;
}
#d {
text-decoration :blink ;
}
.text p {
width :25em ;
margin-right :2em ;
}
其中html和css均放在同一目录下 展开
<html>
<head>
<link rel = "stylesheet" type = "css/text" href = "decoration.css" />
</head>
<body>
<table align = "right">
<tr><th>Home</th></tr>
<tr><th>Info</th></tr>
<tr><th>Help</th></tr>
<tr><th>News</th></tr>
</table>
<h1>I <em>love</em> to decorate!</h1>
<p>I think that decorating <span class = "oops">cakes</span> HTML is lots of fun.Here are some of my favorites.
<div class = "text">
<p id = "a">Undelined text(don't you want to click here?)</p>
<p id = "b">Line-through text</p>
<p id = "c">Overlined text</p>
<p id = "d">Blinking text (this is hard to show in print!)</p>
</div>
</body>
</html>
--------------------------------------------------------------------------------
decoration.css
em {
text-decoration :underline ;
}
table {
border :1em solid fuchsia ;
font-weight :bold ;
font-family :ubuntu ;
}
.oops {
text-decoration :line-through ;
}
.text {
padding :2em 1em auto 2em ;
margin :3em 5em auto 1em ;
border :1px solid teal ;
}
#a {
text-decoration :underline ;
}
#b {
text-decoration :line-through ;
}
#c {
text-decoration :overline ;
}
#d {
text-decoration :blink ;
}
.text p {
width :25em ;
margin-right :2em ;
}
其中html和css均放在同一目录下 展开
3个回答
展开全部
错误在于:
<link rel = "stylesheet" type = "css/text" href = "decoration.css" />
中的type属性应为"text/css",你写反了。
<link rel = "stylesheet" type = "css/text" href = "decoration.css" />
中的type属性应为"text/css",你写反了。
本回答被提问者采纳
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
展开全部
不同内核对代码的支持能力不一样,尽量少用不兼容的代码吧
已赞过
已踩过<
评论
收起
你对这个回答的评价是?
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询