- HTML Links
- HTML Links — Hyperlinks
- HTML Links — Syntax
- Example
- HTML Links — The target Attribute
- Example
- Absolute URLs vs. Relative URLs
- Example
- Absolute URLs
- Relative URLs
- HTML Links — Use an Image as a Link
- Example
- Link to an Email Address
- Example
- Button as a Link
- Example
- Link Titles
- How to Create a Link With Simple HTML Programming
- Linking to Another Web Page
- Linking Within a Page
- Header Text Link to this by adding #topheader to the URL. Paragraph text Link to this by adding #introparagraph to the URL. Community Q&A While most programs will run fine on 32 bit PCs (or have an alternative 32 bit version of software), gamers go for 64 bit because it allows for more RAM. You need to ask yourself if you need it. Thanks! We’re glad this was helpful. Thank you for your feedback. As a small thank you, we’d like to offer you a $30 gift card (valid at GoNift.com). Use it to try out great new products and services nationwide without paying full price—wine, food delivery, clothing and more. Enjoy! Claim Your Gift If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow You’ll want to take a look at JavaScript and jQuery for animating and dynamically creating elements on the fly. These programming languages/libraries can let you adjust the content of the link whenever you want (on the viewer’s screen). Thanks! We’re glad this was helpful. Thank you for your feedback. As a small thank you, we’d like to offer you a $30 gift card (valid at GoNift.com). Use it to try out great new products and services nationwide without paying full price—wine, food delivery, clothing and more. Enjoy! Claim Your Gift If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow First, you need to find the URL for the webpage you want to link to. In your HTML, you will use this line of code to link to the site. If you want, you could mess with the style and add text to the link. Thanks! We’re glad this was helpful. Thank you for your feedback. As a small thank you, we’d like to offer you a $30 gift card (valid at GoNift.com). Use it to try out great new products and services nationwide without paying full price—wine, food delivery, clothing and more. Enjoy! Claim Your Gift If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow You can use Cascading Style Sheets (CSS) to modify the appearance of a link in all four of its (4) states: Link, Visited, Hover, and Active. Be sure to remember to close the tag with a corresponding . If you forget to do this, most browsers will change the rest of the page text into a link! You Might Also Like How to Change 4-Digit User Codes on Schlage Locks How to Delay a Batch File: Timeout, Pause, Ping, Choice & Sleep How to Factory Reset a Schlage Lock & Restore the Default Programming Code Learn to Write Pseudocode: What It Is and Why You Need It 3 Ways to Download GitHub Directories and Repositories Источник
- Community Q&A
- You Might Also Like
HTML Links
Links are found in nearly all web pages. Links allow users to click their way from page to page.
HTML Links — Hyperlinks
HTML links are hyperlinks.
You can click on a link and jump to another document.
When you move the mouse over a link, the mouse arrow will turn into a little hand.
Note: A link does not have to be text. A link can be an image or any other HTML element!
HTML Links — Syntax
The link text is the part that will be visible to the reader.
Clicking on the link text, will send the reader to the specified URL address.
Example
This example shows how to create a link to W3Schools.com:
By default, links will appear as follows in all browsers:
- An unvisited link is underlined and blue
- A visited link is underlined and purple
- An active link is underlined and red
Tip: Links can of course be styled with CSS, to get another look!
HTML Links — The target Attribute
By default, the linked page will be displayed in the current browser window. To change this, you must specify another target for the link.
The target attribute specifies where to open the linked document.
The target attribute can have one of the following values:
- _self — Default. Opens the document in the same window/tab as it was clicked
- _blank — Opens the document in a new window or tab
- _parent — Opens the document in the parent frame
- _top — Opens the document in the full body of the window
Example
Use target=»_blank» to open the linked document in a new browser window or tab:
Absolute URLs vs. Relative URLs
Both examples above are using an absolute URL (a full web address) in the href attribute.
A local link (a link to a page within the same website) is specified with a relative URL (without the «https://www» part):
Example
Absolute URLs
W3C
Relative URLs
HTML Images
CSS Tutorial
HTML Links — Use an Image as a Link
To use an image as a link, just put the tag inside the tag:
Example
Link to an Email Address
Use mailto: inside the href attribute to create a link that opens the user’s email program (to let them send a new email):
Example
Button as a Link
To use an HTML button as a link, you have to add some JavaScript code.
JavaScript allows you to specify what happens at certain events, such as a click of a button:
Example
Tip: Learn more about JavaScript in our JavaScript Tutorial.
Link Titles
The title attribute specifies extra information about an element. The information is most often shown as a tooltip text when the mouse moves over the element.
How to Create a Link With Simple HTML Programming
This article was co-authored by wikiHow Staff. Our trained team of editors and researchers validate articles for accuracy and comprehensiveness. wikiHow’s Content Management Team carefully monitors the work from our editorial staff to ensure that each article is backed by trusted research and meets our high quality standards.
This article has been viewed 99,833 times.
Once you’ve created a couple web pages using HTML, you’ll want to connect them into a larger site. Learn how to link from one page of your site to another, or to any other site on the internet. You can even send your visitors to a specific spot on the page to save them scrolling time.
Linking to Another Web Page
Open your HTML file. Open the HTML file for the page you would like to edit. (If you’re starting from scratch and need some background info, create the document before reading this article.)
- You can also turn an image into a link:
.
The user will see the image wikihow_logo.png, and can click the image to visit https://www.wikihow.com/.
- Always surround the URI with quotation marks.
- URIs are case sensitive. [1] X Research source Copy-paste them or type them in exactly as they appear.
- To link to a page in a subfolder, include the new file path. For example, if you’re on the page http://example.edu/about/author.html and want to link to http://example.edu/about/pets/dog.jpg , you can skip everything up to «about:»
Link text - To link to a page in a different branch of the site, use «../» to move up to a higher folder. For example, to link from /about/author.html to http://example.edu/writing/books.html , type:
Link text
Linking Within a Page
- Anchor text.
This will display as normal text, since it is the destination of a link and not a link itself. You can replace «anchorname» with any name, as long as you don’t use the same name twice on one page.
-
Header Text
Link to this by adding #topheader to the URL.
-
Paragraph text
Link to this by adding #introparagraph to the URL.
Community Q&A
While most programs will run fine on 32 bit PCs (or have an alternative 32 bit version of software), gamers go for 64 bit because it allows for more RAM. You need to ask yourself if you need it.
Thanks! We’re glad this was helpful.
Thank you for your feedback.
As a small thank you, we’d like to offer you a $30 gift card (valid at GoNift.com). Use it to try out great new products and services nationwide without paying full price—wine, food delivery, clothing and more. Enjoy! Claim Your Gift If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow
You’ll want to take a look at JavaScript and jQuery for animating and dynamically creating elements on the fly. These programming languages/libraries can let you adjust the content of the link whenever you want (on the viewer’s screen).
Thanks! We’re glad this was helpful.
Thank you for your feedback.
As a small thank you, we’d like to offer you a $30 gift card (valid at GoNift.com). Use it to try out great new products and services nationwide without paying full price—wine, food delivery, clothing and more. Enjoy! Claim Your Gift If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow
First, you need to find the URL for the webpage you want to link to. In your HTML, you will use this line of code to link to the site. If you want, you could mess with the style and add text to the link.
Thanks! We’re glad this was helpful.
Thank you for your feedback.
As a small thank you, we’d like to offer you a $30 gift card (valid at GoNift.com). Use it to try out great new products and services nationwide without paying full price—wine, food delivery, clothing and more. Enjoy! Claim Your Gift If wikiHow has helped you, please consider a small contribution to support us in helping more readers like you. We’re committed to providing the world with free how-to resources, and even $1 helps us in our mission. Support wikiHow
You can use Cascading Style Sheets (CSS) to modify the appearance of a link in all four of its (4) states: Link, Visited, Hover, and Active.
Be sure to remember to close the tag with a corresponding . If you forget to do this, most browsers will change the rest of the page text into a link!
You Might Also Like
How to Change 4-Digit User Codes on Schlage Locks
How to Delay a Batch File: Timeout, Pause, Ping, Choice & Sleep
How to Factory Reset a Schlage Lock & Restore the Default Programming Code
Learn to Write Pseudocode: What It Is and Why You Need It
3 Ways to Download GitHub Directories and Repositories