测试用例:
bb.html<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>引用外部css样式 </title> <link href="aa.css" rel="stylesheet" type="text/css">
</head> <body>
页面的背景色和北京图片
</body>
</html> aa.css
body{ background-color:#0000FF;}
body{ background-image:url(google.gif); background-repeat:repeat-x;}
没发现什么问题,测试效果如下图。
bb.html<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>引用外部css样式 </title> <link href="aa.css" rel="stylesheet" type="text/css">
</head> <body>
页面的背景色和北京图片
</body>
</html> aa.css
body{ background-color:#0000FF;}
body{ background-image:url(google.gif); background-repeat:repeat-x;}
没发现什么问题,测试效果如下图。
<style type="text/css">
body{ background-color:#0000FF;} /*这个不能用外部样式?*/
body{ background-image:url(google.gif); background-repeat:repeat-x;}
</style>
<style type="text/css">
body{ background-color:#0000FF;}
body{ background-image:url(google.gif); background-repeat:repeat-x;}
</style>
学习下:
http://www.w3school.com.cn/css/css_howto.asp