Link block
Learn how to use Link blocks to turn any element, like an image, or any layout, like a banner, into a link.
Link blocks are similar to Div blocks in that they can be used for structure and layout, but the area inside of the Link block becomes a link. Link blocks can turn any element, like an image, or any layout, like a banner, into a link.
In this lesson:
- Add a Link block
- Add other elements inside the Link block
- Set the link type
- Style the Link block
- Convert a Div block into a Link block and vice versa
Add a link block
To add a Link block to your project, open the Elements Panel (shortcut: A) in the left sidebar, and drag a Link block element onto your page.
Add elements into the Link block
Any element, except for other links, can be dragged into the Link block, either from the Add panel or from the canvas.
PRO TIP: Other links are not allowed to be nested inside a link block, but what you can do is drop in a text block element and style it to look like a button or use your button class.
Set the link type and value
Like Text links and Buttons, Link blocks have the same link options — URL, page, collection page (when applicable) page section, email, phone, and file. Learn more about link settings.
Style Link blocks
Link blocks are as flexible as Div blocks when creating layout and structure. They're often used to create layouts, like a list of blog posts, that link to other pages.
Style the hover state of Link blocks
Link blocks are interactive, so it’s best practice to set a different hover state on the Link block to show users that it’s clickable. Follow these steps to style the hover state:
- Select the Link block
- Click states and choose hover
- Add a box shadow or any other style property
- Go to the none/default state
- Create a transition for the box shadow property or any other style property you styled in the hover state
Try changing the background image on hover:
- Add a background image to the Link block
- Go to States > Hover
- Change the background image
- Go to the none/default state
- Create a transition for the background image property
Override the blue text
By default when any text is placed inside of a Link block, it displays blue and underlined because that’s the default text styling on the All links tag.
You can change the default link styling on a specific Link block by overriding the text decoration and font color:
- Select the Link block
- Go to the Style Panel
- Change text decoration to none
- Change the font color to black
Setting the text decoration on the text element itself to "none" will not remove the underline from the text. To remove the underline you’ll need to style the Link block directly.
Convert a Div block into a Link block and vice versa
Changing Link blocks to Div blocks and vice versa is helpful when you realize that you used a div block instead of a link block to group elements. It's also useful to quickly swap one for the other if you need to change the way the block functions.
Convert a Link block to a Div block
To change a Link block to a Div block, right-click the Link block and convert it to a Div block.
Convert a Div block to a Link block
To change a Div block to a Link block, right-click the Div block and convert it to a Link block.
Note that if your Div block contains any link element, you’ll see an error and you won't be able to convert the Div block to a Link block. That's because, it's not possible to nest links. You need to start by removing all link elements nested in the Div block, or converting Link blocks to Div blocks.