html中p元素添加超链接_如何在HTML中添加超链接

html中p元素添加超链接

How To Build a Website With HTML 如何使用HTML构建网站

This tutorial series will guide you through creating and further customizing this website using HTML, the standard markup language used to display documents in a web browser. No prior coding experience is necessary but we recommend you start at the beginning of the series if you wish to recreate the demonstration website.

本教程系列将指导您使用HTML(用于在Web浏览器中显示文档的标准标记语言)创建和进一步自定义此网站 。 不需要任何编码经验,但是如果您希望重新创建演示网站,建议您从本系列的开头开始 。

At the end of this series, you should have a website ready to deploy to the cloud and a basic familiarity with HTML. Knowing how to write HTML will provide a strong foundation for learning additional front-end web development skills, such as CSS and JavaScript.

在本系列的最后,您应该拥有一个可以部署到云的网站,并且对HTML有了基本的了解。 知道如何编写HTML将为学习其他前端Web开发技能(例如CSS和JavaScript)奠定坚实的基础。

This tutorial will walk you through the steps of adding hyperlinks to your webpage.

本教程将引导您完成将超链接添加到网页的步骤。

Hyperlinks can be added to text or images with the anchor link element . The tag requires the attribute href, which is used to specify the destination link. The element is used like this:

可以使用锚链接元素链接添加到文本或图像。 标记需要属性href ,该属性用于指定目标链接。 元素的用法如下:

The text you want to link

Try adding the code snippet below to your “index.html” file and changing the sample highlighted text with a real link, such as https://digitalocean.com/community:

尝试将以下代码片段添加到“ index.html”文件中,并使用真实链接(例如https://digitalocean.com/community更改示例突出显示的文本:

The text you want to link

(If you have not been following the tutorial series, you can review instructions for setting up an index.html file in our tutorial Setting Up Your HTML Project. Save the file and load it in your browser.

(如果您还没有按照本教程系列进行操作,则可以在我们的教程“ 设置HTML项目”中查看有关设置index.html文件的说明。保存该文件并将其加载到浏览器中。

You should receive an output like this:

您应该收到如下输出:

You can also link images by wrapping an image element with an element like so:

您还可以通过将图像元素包装为元素来链接图像,如下所示:

The text you want to link

Try testing the code snippet in your browser to check that it works. You should now understand how to add hyperlinks to text and images on your webpage.

尝试在浏览器中测试代码段,以检查其是否有效。 现在,您应该了解如何在网页上向文本和图像添加超链接。

翻译自: https://www.digitalocean.com/community/tutorials/how-to-add-hyperlinks-in-html

html中p元素添加超链接

你可能感兴趣的:(python,java,html,css,js)