html用vscode打开中文乱码
右键记事本打开,另存为编码改为UTF-8
再用vscode打开就可以正常显示了
添加基本标签
<html>
<body>
<h1>我的第一个标题</h1>
<p>我的第一个段落。</p>
<em>斜体</em>.
</body>
</html>
居中
相对路径添加图片
<img src="../images/green.jpg">
添加样式
–style 元素位于 head 元素中。
<head>
<title>Starbuzz Coffee</title>
<style type="text/css">
body {
background-color: #d2b48c;
margin-left: 20%;
margin-right: 20%;
border: 1px dotted black;
padding: 10px 10px 10px 10px;
font-family: sans-serif;
}
</style>
</head>
添加超链接
带下标的elixirs
点击跳转到elixir.html页面
引用
效果:
效果:
列表
效果:
样例:
链接内容加title属性
target属性
第四章
背景音乐:
l使用<embed>标记则可以插入各种各样的多媒体,如WMV、MP3、AVI、SWF、MOV、RMVB等格式的多媒体文件。
而bgsound只能添加音乐文件,不能显示