Learning Notes for HTML/CSS/JS

@1:内部样式表 & 外部样式表

内部样式表的定义,放在<style></style>中,<style>标签放在<head>中

Learning Notes for HTML/CSS/JS
<html>
<head>
    <title>Demo</title>
    <style type="text/css" media="screen">
        h1 {
            color:red;
            font-style:italic;
        }   
    </style>
</head>
<body>
    <h1>heading</h1>
</body>
</html>
Learning Notes for HTML/CSS/JS

当多个HTML文档使用相同的样式表定义时,就应该使用外部样式表。通过在<head>标签中插入<link>标签,来将外部样式表文件链接到HTML文档中。

Learning Notes for HTML/CSS/JS
<html>
<head>
    <title>Demo</title>
    <link rel="stylesheet" href="css/demo.css" type="text/css" media="screen" charset="utf-8">
    <style type="text/css" media="screen">
        h1 {
            color:red;
            font-style:italic;
        }   
    </style>
</head>
<body>
    <h1>heading</h1>
</body>
</html>
Learning Notes for HTML/CSS/JS

Learning Notes for HTML/CSS/JS,布布扣,bubuko.com

Learning Notes for HTML/CSS/JS

上一篇:实现网页页面跳转的几种方法(meta标签、js实现、php实现)


下一篇:Asp.net 字体样式