css的引用文件方式

css的引用文件方式

1 使用<link>元素链接到外部的样式文件

eg:<link rel=”stylesheet” type=”text/css” href=”http://www.php1.cn/”>2 在<head>元素中使用”style”元素来指定

eg:<html>
<head>
<title>css demo</title>
<link rel=stylesheet type=”text/css” href=”http://www.php1.cn/”> <style>
@import url(css/name.css);
H1 {color:red}
</style>
</head>
<body>
<H1>CSS demo</H1>
<p style=”color:blue”>good luck.</p>
</body>
</html>
3 使用CSS ”标记来导入样式表单
eg:<style type=”text/css”>
@import url(default.css);
</style>
或:<style type=”text/css”>
@import url(“default.css”);
</style>
4 在<body>内部的元素中使用”style”属性来定义样式

eg:<p style=”width:800px;”></p>

css的引用文件方式

相关文章:

你感兴趣的文章:

标签云: