Can you link a div in guided landing page template? | Community
Skip to main content
New Participant
February 3, 2021
Solved

Can you link a div in guided landing page template?

  • February 3, 2021
  • 2 replies
  • 3590 views

Hello,

I'm trying to link a div in a guided landing page template but the text editor keeps throwing out the <a> tag when it's wrapped around a div. Is there a way around this? I'd rather not move the mktoText to the inner div and make the link a variable since I'd like the user to be able to make that dynamic. 

<div class="tile mktoText" id="fourTileRow1Col1Title" mktoName="4 Tile Row 1 Col 1 Title"> <a class="text-link " href="#" target="_blank"> <div> <h3>Title</h3> <p>Text</p> </div> </a> </div>
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by Dave_Roberts

The way I've typically seen this done is to have them be separate elements inside a relatively positioned parent element. Here's a really loose example of something like that:

<div style="position:relative;"> <div>...some stuff in a div... </div> <a href="#" style="position:absolute; top:0; left:0; height:100%; width:100%; z-index:1;"></a> </div>

The idea is to use the inner div to create the height and width and "overlay" the link atop the inner div. 

 

 

2 replies

Dave_Roberts
Dave_RobertsAccepted solution
New Participant
February 5, 2021

The way I've typically seen this done is to have them be separate elements inside a relatively positioned parent element. Here's a really loose example of something like that:

<div style="position:relative;"> <div>...some stuff in a div... </div> <a href="#" style="position:absolute; top:0; left:0; height:100%; width:100%; z-index:1;"></a> </div>

The idea is to use the inner div to create the height and width and "overlay" the link atop the inner div. 

 

 

kana0_0ngAuthor
New Participant
February 8, 2021

Thank you! I had forgotten that's how it used to be done.

Employee
February 4, 2021

Hi,

 

You cannot use <div> or header tags (h1, h2) inside <a> tags. You can only use inline elements like span or something inside an anchor tag. 

I'll suggest use a span tag and give styles according to header and paragraph. 

SanfordWhiteman
New Participant
February 4, 2021

You cannot use <div> or header tags (h1, h2) inside <a> tags.

You can in HTML5.

kana0_0ngAuthor
New Participant
February 4, 2021

Right, and I already have the HTML5 doctype in the template. Guess it's just a limitation of the text editor.