HTML番外篇-部分命令
Aqua水
fuchsia紫红色
lime石灰
maroon栗色
navy海军蓝
olive橄榄
silver银色
teal蓝绿色
<img src=”url” />
<td>表格内容
<tr>表格行
<th>表头
<table border= “1”>
< >空格
<caption>标题
<th colspan="2">占行数
<th colspan="2">占列数
<ul>无序列表
<li>圆点
自定义列表以 <dl> 标签开始。每个自定义列表项以 <dt>
有序列表始于 <ol> 标签。每个列表项始于 <li> 标签。
<hr /> 标签在 HTML 页面中创建水平线
颜色及格式
<html>
<body style="background-color:yellow">
<h2 style="background-color:red">This is a heading</h2>
<p style="background-color:green">This is a paragraph.</p>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
span.red {color:red;}
</style>
</head>
<body>
<h1>My <span class="red">Important</span> Heading</h1>
</body>
</html>
<!DOCTYPE html>
<html>
<head>
<style>
.cities {
background-color:black;
color:white;
margin:20px;
padding:20px;
}
</style>
</head>
<body>
<div class="cities">
<h2>London</h2>
<p>London is the capital city of England.
It is the most populous city in the United Kingdom,
with a metropolitan area of over 13 million inhabitants.</p>
</div>
<div class="cities">
<h2>Paris</h2>
<p>Paris is the capital and most populous city of France.</p>
</div>
<div class="cities">
<h2>Tokyo</h2>
<p>Tokyo is the capital of Japan, the center of the Greater Tokyo Area,
and the most populous metropolitan area in the world.</p>
</div>
</body>
</html> id属性
id属性用于为 HTML 元素指定唯一的 id
id属性的值在 HTML 文档中必须是唯一的
CSS 和 JavaScript 可使用id属性来选取元素或设置特定元素的样式
id属性的值区分大小写
-
id属性还可用于创建 HTML 书签
JavaScript 可以使用getElementById()方法访问拥有特定 id 的元素
通过HTML调用文件
<iframe src=”URL”></iframe>
<iframe src=”demo_iframe.htm” width=”200” height=”200”></iframe>
删除边框
<iframe src=”demo_iframe.htm”frameborder=”0”></iframe>
<samp>元素定义计算机输出示例
<code>元素定义编程代码
(以下部分列表来自W3school)
| <code> | 定义计算机代码文本 |
| <kbd> | 定义键盘文本 |
| <samp> | 定义计算机代码示例 |
| <var> | 定义变量 |
| <pre> | 定义预格式化文本 |
| | 空格 | |   |
| < | 小于号 | < | < |
| > | 大于号 | > | > |
| & | 和号 | & | & |
| " | 引号 | " | " |
| ' | 撇号 | ' | ' |
| ¢ | 分(cent) | ¢ | ¢ |
HTML中支持的数学符号
| ∀ | ∀ | ∀ | FOR ALL |
| ∂ | ∂ | ∂ | PARTIAL DIFFERENTIAL |
| ∃ | ∃ | ∃ | THERE EXISTS |
| ∅ | ∅ | ∅ | EMPTY SETS |
| ∇ | ∇ | ∇ | NABLA |
| ∈ | ∈ | ∈ | ELEMENT OF |
| ∉ | ∉ | ∉ | NOT AN ELEMENT OF |
| ∋ | ∋ | ∋ | CONTAINS AS MEMBER |
| ∏ | ∏ | ∏ | N-ARY PRODUCT |
| ∑ | ∑ | ∑ | N-ARY SUMMATION |
#前端##软件开发#

