html结构
html的基本结构:
doctype的作用:<!DOCTYPE>声明位于文档中的最前的位置,处于标签之前。此标签可告知浏览器文档使用哪种HTML或XHTML规范。
html的基本结构:
<html>
<head>
</head>
<body>
</body>
</html>
html标签
1、<html>是根标签
2、<head>标签是头文件。里边有:
<title>标题</title>
<link rel="stylesheet" src="css文件路径"/>
<style>
行间样式
</style>
<script type="text/javascript" src="js文件路径"></script>
<script>
行间样式
</script>
<meta charset="uft-8"/><!--声明编码。--!>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1"/>优先使用IE最新版本和Chrome
<meta name="renderer" content="webkit|ie-comp|ie-stand">
浏览器内核控制。国内浏览器很多都是双内核(webkit和trident),webkit内核高速浏览。ie内核兼容网页和旧版本网站。而添加meta标签的网站可以控制浏览器选择何种内核渲染。
<meta name="keywords" content="your tags关键字内容,"/>页面关键字
<meta name="descripition" content="120|150words"/>
<meta name="robots" content="index,follow"/>
搜索引擎索引方式。all:文件将被索引,且页面上的链接可以被查询;none:文件将不被检索,且页面上的链接不可以被查询;index:文件将被检索;follow:页面上的链接可以被查询;noindex:文件将不被检索;nofollow:页面上的链接不可以被查询。
<meta http-equiv="refresh" content="0; url="/>
content内的字数代表时间(秒),即多少时间后刷新,如果加url,则会重定向到指定网页
<meta name="author" content="author name"/>网页作者信息
<meta name="viewport" content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=no"/>运用于移动设备的屏幕自适应
<meta name="apple-mobile-web-app-capable" content="yes"/>webapp全屏模式:伪装app,离线应用。
<meta name="apple-mobile-web-app-status-bar-style" content="black-translucent"/>
content的值为default|black|black-translucent.运用于隐藏状态栏/设置状态栏颜色:只有在开启webapp全屏模式时才生效。
<meta name="apple-mobile-web-app-title" content="标题">content的值为default|black|black-translucent.
<meta content="telephone=no" name="format-detection"/>忽略数字自动识别为电话号码。
<meta content="email=no" name="format-detection/">
以上是可以写在<head>中的标签
3、<body>里面放置的标签,标签分为块级和行级标签
内容参考html和css知识总结部分
