Blogger Information
Blog 18
fans 0
comment 0
visits 15814
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
Html 标签理解及应用
沉寂的博客
Original
657 people have browsed it

html 标签理解及应用

html 标签可以分为单标签和双标签,都是文档流的元素,段落和标题标签 ,
如下所示标题标签为 h1-h6,常用为 h1-h3。

例如,

  1. <h1>Html</h1>
  2. <h2>Css3</h2>
  3. <h3>Javascript</h3>

h1-h3效果图

a标签

a标签是整个网页的灵魂元素,因为一个页面上的元素大部分都要配合a标签使用,实例如下
a标签最长用的方法就是页面之间的跳转。
<a href='https://www.php.cn/'>php中文网</a>

a标签的特殊用法

a标签用在iframe内联框架中

tatget name属性的值与a标签target属性的值相同时点击a标可以直接在iframe内联框架中显示

  1. <a href="https://www.baidu.com/" target="baidu">点我看看</a>
  2. <iframe
  3. name="baidu"
  4. frameborder="0"
  5. srcdoc="请点击:点我看看"
  6. style="border: 1px solid red; width: 500px; height: 200px"
  7. ></iframe>

代码执行结果:

iframe与a

a标签还可以做为一个锚点使用

a标签可以实现网页底部和顶部的跳转,使用锚点(id),首先给底部 footer 的div一个 id 属性值为footer创建一个锚点,代码如下:

  1. <a href='#footer'>点击我到达本页面底部</a>
  2. <!--创建锚点-->
  3. <div id='footer'>我是底部</div>
  4. <a href='#'>点击我返回本页面顶部</a>

</div>

Correcting teacher:天蓬老师天蓬老师

Correction status:qualified

Teacher's comments:
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!