一张图片上显示多个链接的例子

<html>
<body>


<p>请点击图像上的星球,把它们放大。</p>


<img
src="http://www.w3school.com.cn/i/eg_planets.jpg"     <!---背景图片 背景图片上存在的区域图片可以作为超链接的识别区域-->
border="0" usemap="#planetmap"
alt="Planets" />


<map name="planetmap" id="planetmap">  <!--- map是图形控制的标识 -->

<!--  以第一个area为例子:area是每个图形区域    shape : 图像样式 coords: 大小位置 例如:(x,y)=(180,139),r=14 -->

<!-- target:在哪里显示新网页 alt: 提示 href:区域链接 -->

<area
shape="circle"       
coords="180,139,14"
href ="http://www.w3school.com.cn/example/html/venus.html"
target ="_blank"
alt="Venus" />


<area
shape="circle"
coords="129,161,10"
href ="http://www.w3school.com.cn/example/html/mercur.html"
target ="_blank"
alt="Mercury" />


<area
shape="rect"
coords="0,0,110,260"
href ="http://www.w3school.com.cn/example/html/sun.html"
target ="_blank"
alt="Sun" />


</map>


<p><b>注释:</b>img 元素中的 "usemap" 属性引用 map 元素中的 "id" 或 "name" 属性(根据浏览器),所以我


们同时向 map 元素添加了 "id" 和 "name" 属性。</p>


</body>

</html>

显示效果在:   http://www.w3school.com.cn/tiy/t.asp?f=html_areamap   可查看效果

假设我们要制作一个简单的个人博客网页,以下是一个简单的示例: 1. 首先,我们需要编写HTML代码来创建网页结构。我们可以使用以下代码来创建一个基本的HTML文档: ``` <!DOCTYPE html> <html> <head> <title>My Personal Blog</title> </head> <body> <h1>Welcome to my blog!</h1> <p>This is where I share my thoughts and experiences.</p> </body> </html> ``` 2. 下一步是添加样式。我们可以使用CSS来添加样式。以下是一个简单的CSS样式表,可以为网页添加样式: ``` body { background-color: #f2f2f2; font-family: Arial, sans-serif; } h1 { color: #333; text-align: center; } p { font-size: 18px; line-height: 1.5; margin: 20px; } ``` 3. 接下来是添加内容。我们可以添加文章、图像、链接等内容。以下是一个简单的示例: ``` <!DOCTYPE html> <html> <head> <title>My Personal Blog</title> <style> body { background-color: #f2f2f2; font-family: Arial, sans-serif; } h1 { color: #333; text-align: center; } p { font-size: 18px; line-height: 1.5; margin: 20px; } </style> </head> <body> <h1>Welcome to my blog!</h1> <p>This is where I share my thoughts and experiences.</p> <h2>Latest Post</h2> <h3>My trip to Paris</h3> <p>Recently, I had the opportunity to visit Paris and it was an incredible experience. The city is full of history, culture, and amazing food. I visited the Eiffel Tower, the Louvre, and many other famous landmarks. I also tried some of the local cuisine, including croissants, crepes, and escargot.</p> <img src="paris.jpg" alt="Paris" width="500"> <h2>Other Posts</h2> <ul> <li><a href="#">10 Tips for Traveling on a Budget</a></li> <li><a href="#">My Favorite Books of the Year</a></li> <li><a href="#">How to Start a Successful Blog</a></li> </ul> </body> </html> ``` 这个简单的网页包括一个欢迎信息、一个最新文章、一张图片和一些其他文章链接。这只是一个简单的示例,但是在一个真正的网站上,我们将会添加更多的功能和页面。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值