怎么引用的外部样式表没用呢

c940157769 2014-08-07 09:47:37
这是 html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<link type="text/css" rel="stylesheet" herf="style/index.css">
</head>

<body>
<div>text</div>
</body>
</html>

这是 css

@charset "utf-8";
/* CSS Document */

html{height:100%;border:none;}
body{height:100%;border:none;padding:0;margin:0;text-align:center;font-size:14px;color:#000;background-color:#FFF;}
div,ul,li,img{margin:0;padding:0;border:none;}
ul{list-style-type:none;}
table,input{font-size:12px;}
a:link{ color:#09F; text-decoration:none; }
a:visited{ color:#09F; text-decoration:none; }
a:hover{ color:#09F; text-decoration:none; }
a:active{ color:#09F; text-decoration:none; }

.mass{width:762px;}
.center{text-align:center;}
.clear{ clear:both;visibility:hidden;font-size:0px;}

...全文
216 2 打赏 收藏 转发到动态 举报
写回复
用AI写文章
2 条回复
切换为时间正序
请发表友善的回复…
发表回复
c940157769 2014-08-07
  • 打赏
  • 举报
回复
引用 1 楼 jikeytang 的回复:
<link type="text/css" rel="stylesheet" herf="style/index.css"> <link rel="stylesheet" type="text/css" href="style/index.css" />
怎么让这个框居中呢 css码 @charset "utf-8"; /* CSS Document */ html{height:100%;border:none;} body{height:100%;border:none;padding:0;margin:0;text-align:center;font-size:14px;color:#000;background-color:#FFF;} div,ul,li,img{margin:0;padding:0;border:none;} ul{list-style-type:none;} table,input{font-size:12px;} a:link{ color:#09F; text-decoration:none; } a:visited{ color:#09F; text-decoration:none; } a:hover{ color:#09F; text-decoration:none; } a:active{ color:#09F; text-decoration:none; } .mass{width:1024px;} .center{text-align:center;} .clear{ clear:both;visibility:hidden;font-size:0px;} .border{ border:#F00 solid 1px;} html 码 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <html xmlns="http://www.w3.org/1999/xhtml"> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8" /> <title>无标题文档</title> <link type="text/css" rel="stylesheet" href="style/index.css"> </head> <body> <div class="border mass">text</div> </body> </html>
豪情 2014-08-07
  • 打赏
  • 举报
回复
<link type="text/css" rel="stylesheet" herf="style/index.css"> <link rel="stylesheet" type="text/css" href="style/index.css" />

61,112

社区成员

发帖
与我相关
我的任务
社区描述
层叠样式表(英文全称:Cascading Style Sheets)是一种用来表现HTML(标准通用标记语言的一个应用)或XML(标准通用标记语言的一个子集)等文件样式的计算机语言。
社区管理员
  • HTML(CSS)社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧