HTML学习笔记

HTML学习笔记

一、标签

在html中每个标签都是成对存在

例如:

<html>
	<body>
        <h1>
            Hello CSDN!
        </h1>
    </body>    
</html>
二、属性

写在<>里面的用来定义功能的作用

例如:

Hello world!

<h2 style="background-clolor: red;text-align:center">
    Hello world!
</h2>

三、标题

使用 <h1> -><h6>来规定标题的字号大小

使用<hr/>创建一个分割线

<h1>
    I am a heading
</h1>
<hr/>
<h2>
    I am a small heading
</h2>
四、段落

使用<p>something</p>来写一个段落内容

可在something中加<br/>来换行

**注释:**浏览器会自动地在段落的前后添加空行,并且自动将多个空格处理为一个空格

<p>
    写入你先说的话就能显示在浏览器上了
</p>
五、样式

style属性

  • background-color背景颜色
  • font-family字体 arial
  • color颜色 red
  • font-size大小 20px
  • text-align 对齐方式 center

This is a red heading

This text is in Verdana and red

This text is in Times and green

This text is 30 pixels high

 <h2 style="background-color: red;text-align: center">This is a red heading
	 	<h2/>
	<p style="font-family:verdana;color:red">
	This text is in Verdana and red</p>

	<p style="font-family:times;color:green">
	This text is in Times and green</p>

	<p style="font-size:30px">This text is 30 pixels high</p>

六、文本格式化
  • 文本格式化标签
标签描述
<b>定义粗体文本。
<big>定义大号字。
<em>定义着重文字。
<i>定义斜体字。
<small>定义小号字。
<strong>定义加重语气。
<sub>定义下标字。
<sup>定义上标字。
<ins>定义插入字。
<del>定义删除字。
<s>*不赞成使用。*使用 代替。
<strike>*不赞成使用。*使用 代替。
<u>*不赞成使用。*使用样式(style)代替。
  • 计算机输出 标签
标签描述
<code>定义计算机代码。
<kbd>定义键盘码。
<samp>定义计算机代码样本。
<tt>定义打字机代码。
<var>定义变量。
<pre>定义预格式文本。
<listing>*不赞成使用。*使用
 代替。
<plaintext>*不赞成使用。*使用
 代替。
<xmp>*不赞成使用。*使用
 代替。
  • 引用和术语定义
标签描述
<abbr>定义缩写。
<acronym>定义首字母缩写。
<address>定义地址。
<bdo>定义文字方向。
<blockquote>定义长的引用。
<q>定义短的引用语。
<cite>定义引用、引证。
<dfn>定义一个定义项目。

演示

This text is bold

This text is strong

This text is big

This text is emphasized

This text is italic

This text is small

This text contains
subscript

This text contains
superscript

<b>This text is bold</b>
<br />
<strong>This text is strong</strong>
<br />
<big>This text is big</big>
<br />
<em>This text is emphasized</em>
<br />
<i>This text is italic</i>
<br />
<small>This text is small</small>
<br />
This text contains
<sub>subscript</sub>
<br />
This text contains
<sup>superscript</sup>

更多演示请参照:这里

七、引用
  1. 短引用

    短引用 这就是短引用

    <p>短引用 <q>这就是短引用</q></p>
    

    效果:自动加引号

  2. 长引用

    鲁迅先生曾经说过:

    世上本没有路,走的人多了,也便成了路。
    <blockquote >
        世上本没有路,走的人多了,也便成了路。
    </blockquote>
    
  3. 缩略词

    RMB意思是人民币

    <p><abbr title = "Ren Ming Bi">RMB</abbr>意思是人民币</p>
    
  4. 定义

    • title属性

    RMB意思是人民币

    <p><dfn title = "Ren Ming Bi">RMB</dfn>意思是人民币</p>
    
    • 元素

    WHO 成立于 1948 年。

    <p><dfn><abbr title="World Health Organization">WHO</abbr></dfn> 成立于 1948 年。</p>
    
    • 文本内容

    WHO 成立于 1948 年。

    ```html

    WHO 成立于 1948 年。

    ```
  5. 未完待续

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值