Creating interactive and navigable elements on a website is fundamental in web design, and one of the key tools for this is the HTML link tag. This guide will explain how to use link tags effectively to connect various content on your website.

Link Blocks Explained: Clickable Containers

Similar to a div, a link block is a container that can hold various content types, such as text, images, or entire sections. The key difference is its ability to create clickable links.

  1. Select the area where you want the button and add the link tag
  2. Style your link block to resemble a button by choosing colors, margins, and font settings from the design panel
Divhunt's Link Panel

Setting Up Internal & External Links

For internal links (linking within your site):

  1. Select the link block and open the settings panel
  2. Choose the 'Page' option and select an existing page from your project’s dropdown list
Page Dropdown List Preview - Divhunt

For external links (linking to other websites):

  1. Simply paste the desired external URL into the link input field in the settings panel.
Link Input Field - Divhunt

Anchor Links For In-Page Navigation

To direct users to specific sections on the same page:

  • Select the section you want the linked scrolling to target and assign it an ID
Assigning an ID with Divhunt - Preview
  • Choose the text or element you wish to turn into a link and select it
  • In the settings panel, opt for the 'Anchor' option
  • Input the ID of the section you're linking to (the ID previously assigned to your target section)
Link Example - Preview

Set A Scroll Offset For Anchor Links

In the link settings, specify the offset in pixels to control how far above the section the scroll stops, preventing the default behavior where the top of the section aligns with the top of the screen.

Offset Settings Preview - Divhunt

Add Phone & Email Links To Your Page

  1. In the settings panel, select either the 'Phone' or 'Email' option.
  2. Input the phone number or email address where prompted.

Improve Link Security With Rel Attributes

In the settings panel, you'll find options like 'no-follow', 'no-opener', and 'no-referrer' under the 'Rel' field. These can improve the privacy and security of your external links.

  • no-follow: Prevents search engines from following the link
  • no-opener: Enhances security by preventing the new page from accessing the original page
  • no-referrer: Stops the browser from sending the referring URL to the new page
Rel Settings Preview - Divhunt