HTML-h、p、a、img标签小试

1.HTML标题(Heading)

(1)通过<h1> - <h6>等标签进行定义的

示例代码如下:

<span style="font-family:Microsoft YaHei;"><html>
<body>
	<!--h标签,标题-->
	<h1>My First Heading</h1>
	<h1>This is heading-1</h1>
	<h2>This is heading-2</h2>
	<h3>This is heading-3</h3>
	<h6>This is heading-6</h6>
	<h7>My 7 Headings</h7>
	<h11>My di 11 Headings</h11>

</body>
</html></span>
效果图:


2.HTML段落

(1)通过<p>标签进行定义

示例代码:

<span style="font-family:Microsoft YaHei;"><html>
<body>
	
	<!--p标签,段落-->
	<p>My first paragraph.</p>
	<p>This is 1 paragraph.</p>
	<p>This is 2 paragraph.</p> 

	
</body>
</html></span>
效果图:

3.HTML链接

(1)通过<a>标签进行定义

(2)在href属性中,指定链接地址

示例代码:

<span style="font-family:Microsoft YaHei;"><html>
<body>
	<!--a标签,链接-->
	<a href = "http://www.baidu.com">This is 1 link.</a>
	<p><a href="http://www.sina.com">This is 2 link.</a></p>
</body>
</html></span>
展现效果:

4.HTML图像

(1)通过<img>标签进行定义

(2)在src属性中指定图像名称

(3)width属性指定图像的宽度

(4)height属性指定图像的高度

示例代码:

<span style="font-family:Microsoft YaHei;"><html>
<body>
	
	<!--img标签,图像-->
	<img src="testimg1.jpg" width="104" height="142">This is a pic.</img>
	<img src="testimg2.jpg" width="104" height="142"/>
	<a href="http://www.taobao.com"><img src="testimg1.jpg" width="104" height="142"/></a>

</body>
</html></span>
效果:

其中最后一张图片,点击会进入淘宝网页




  • 1
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值