00_HTML
简单的SEO
<html lang="en, zh">
<!-- lang 属性规定元素内容的语言。告诉搜索引擎爬虫,我们的网站内容是关于什么语言的 -->
<meta name="keywords" content="食品">
<meta name="description" content="非常好吃">
<!-- 定义网页的关键字和描述信息 -->
空格的含义
空格在HTML
中语法含义表示字符分隔符
表示空格用
<div style="width:100px;height:100px;boder:1px solid black">
这里面有很多的文字,文字的长度超过了div的长度
</div>
<div style="width:100px;height:100px;border:1px solid black">
The length of the text exceeds the length of the Div
</div>
<div style="width:100px;height:100px;border:1px solid black">
qwertyuiopasdfghjklzxcvbnm
</div>
- 效果:汉字和单词会自动换行,一串字符串不会换行。
- 原因:汉字单独是一个字符,浏览器能识别,英文单词需要空格号作为分隔符,浏览器才能识别,否则识别为一个单词不进行换行。
<a>
标签的含义
-
超链接
-
锚点
<div id="site"></div> · · · <!-- 通过id定位到特定的区域 --> <a herf="#site">定位到site的位置</a> <!-- herf内仅为#时,直接回到网页顶端 --> <a herf="#">定位到网页顶端</a>
-
调用电话或邮件等外部应用
<!-- 多用于移动端,自动调用拨号程序 --> <a herf="tel:123····1234">打电话给小明</a> <!-- 览器会自动开启默认的邮箱软件,并将邮件地址放进接收方中 --> <a herf="mailto:[email protected]">发邮件给小明</a> <!-- 还可以打开QQ --> <a href="tencent://message/?uin=123456&Site=&Menu=yes"> 给QQ好友123456发送消息 </a>
-
协议限定符
<a href="javascript:js_method();">调用方法</a> <!-- 注意:W3C标准不推荐在href里面执行javascript语句 -->