HTML番外篇-部分命令

在HTML中可直接应用的颜色

 Aqua水

fuchsia紫红色

lime石灰

maroon栗色

navy海军蓝

olive橄榄

silver银色

teal蓝绿色

部分命令

<img src=”url” />

<td>表格内容

<tr>表格行

<th>表头

<table border= “1”>

<&nbsp;>空格

<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>

定义预格式化文本

 


空格

&nbsp;

&#160;

小于号

&lt;

&#60;

大于号

&gt;

&#62;

&

和号

&amp;

&#38;

"

引号

&quot;

&#34;

'

撇号 

&apos; 

&#39;

分(cent

&cent;

&#162;

 HTML中支持的数学符号

&#8704;

&forall;

FOR ALL

&#8706;

&part;

PARTIAL DIFFERENTIAL

&#8707;

&exist;

THERE EXISTS

&#8709;

&empty;

EMPTY SETS

&#8711;

&nabla;

NABLA

&#8712;

&isin;

ELEMENT OF

&#8713;

&notin;

NOT AN ELEMENT OF

&#8715;

&ni;

CONTAINS AS MEMBER

&#8719;

&prod;

N-ARY PRODUCT

&#8721;

&sum;

N-ARY SUMMATION



#前端##软件开发#
全部评论
感谢分享,每次就是颜色折腾人
点赞 回复 分享
发布于 2022-08-19 12:14 陕西

相关推荐

仁者伍敌:难怪小公司那么挑剔,让你们这些大佬把位置拿了
点赞 评论 收藏
分享
05-19 15:21
已编辑
华南农业大学 Java
白火同学:你才沟通了200,说实话,北上广深杭这里面你连一座城市的互联网公司都没投满呢,更别说还有各种准一线二线城市了。等你沟通突破了三位数,还没结果再考虑转行的事吧。
点赞 评论 收藏
分享
评论
点赞
收藏
分享

创作者周榜

更多
牛客网
牛客网在线编程
牛客网题解
牛客企业服务