
批改状态:合格
老师批语:总结的很好,继续努力!
<!-- 声明html5文档 -->
<!DOCTYPE html>
<!-- 根标签 -->
<html>
<!-- 头标签-不显示在页面 -->
<head lang='zh-cn'>
<meta charset="UTF-8">
<title>我是标题</title>
</head>
<!-- 主体标签-内容 -->
<body>
</body>
</html>
好了,大概能默出以上主要结构,标签结构解释如下图:
No | 属性 | 备注 |
---|---|---|
1 | style | 行内属性 |
2 | id | ID属性/保证唯一值 |
3 | class | 类属性 |
div
p
h2
等)
<script>
console.log(windows.document.title); //获取标题
</script>
方法 | 说明 |
---|---|
document.scripts | 返回页面中所有脚本的集合。 |
document.title | 返回当前文档的标题。 |
document.URL | 返回文档完整的URL |
document.querySelectorAll() | 返回所有元素节点列表 |
… | … |
还有好多,后续慢慢实践中慢慢学习
<script></script>
标签可以在任何地方使用,不需要声明类型。
vscode代码格式化插件推荐-Prettier - Code formatter
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号