HTML总结 原圳瑀
HTML的学习记录
HTML结构
基础定义
-
<!DOCTYPE html> 声明为HTML5文档
-
<html>元素是HTML页面的根元素
-
<head>元素包含了文档的元的数据
-
<title> 元素描述了文档的标题
-
<body>元素包含了可见的页面内容
-
<h1>-<h6>元素定义大标题
-
<p>元素定义一个段落
特殊作用
-
插入图片:代码例如<img src=“https://mdbootstrap.com/img/logo/mdb192x192.jpg” alt=“MDB Logo” width=“200” height=“200”\
<img src=“picture.jpg”>该图片文件与当前文档在同一目录中
<img src="./images/picture.jpg">该图片文件在当前目录下的
images
目录中<img src="…/picture.jpg">该图片文件在上一级目录中
-
超链接:超链接由<a>标签定义,链接地址在href属性中指定;
例如<a href=“http://www.baidu.com”>百度
-
表格操作:有时候页面内容需要用表格呈现,所以用<table>表格进行操作,代码中<tr>代表行,<td>代表行中单元,<th>是表头的单元。
-
无序列表使用
<ul>
标签,默认使用实心圆点作为每项的标志,其它的标志可以是空心圆circle
,实心方块square
以及不出现标志。有序列表使用
<ol>
标签,默认使用数字作为每项的标志,其它的标志可以是大写字母A
,小写字母a
,罗马字母i
等。 -
文本格式:html字体文本有多种显示格式,
<p>You can use the mark tag to <mark>highlight</mark> text.</p> <p><del>This line of text is meant to be treated as deleted text.</del></p> <p><s>This line of text is meant to be treated as no longer accurate.</s></p> <p><ins>This line of text is meant to be treated as an addition to the document.</ins></p> <p><u>This line of text will render as underlined</u></p> <p><small>This line of text is meant to be treated as fine print.</small></p> <p><strong>This line rendered as bold text.</strong></p> <p><em>This line rendered as italicized text.</em></p>
这样就会显示:
You can use the mark tag to highlight text.
This line of text is meant to be treated as deleted text.This line of text is meant to be treated as no longer accurate.
This line of text is meant to be treated as an addition to the document.
This line of text will render as underlined
This line of text is meant to be treated as fine print.
This line rendered as bold text.
*This line rendered as italicized text.
-
上一篇: PHP的学习-生成器Generators
下一篇: ECMA-262,3rd 中文版详解