I have some html that uses many divs. I wanted to replace one of the divs with an <a> tag instead, but found out that I am not allowed to add <a href> tags inside that div. I have something like this below. Is there a way I could make this work?
thanks
<div class="dd-content">
<div class="dd-lnks">
<h2>About</h2>
<div id='multiCol1' class="dd-content">
<a href="#">item 1 </a>
<a href="#">item 2 </a>
</div>
</div>
And I wanted to replace it with something like this :
<a class="dd-content">
<div class="dd-lnks">
<h2>About</h2>
<div id='multiCol1' class="dd-content">
<a href="#">item 1 </a>
<a href="#">item 2 </a>
</div>
</a>
Beside, why you need to wrap div with ‘dd-lnks’ class inside <a> element?
Best regards
Cathy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Perhaps, we could provide a alternative way of that.
Best regards
Cathy
MSDN Community Support
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
38 Points
338 Posts
wrapping elements inside <a> tag?
Jun 09, 2017 09:24 PM|maggiemays|LINK
hi,
I have some html that uses many divs. I wanted to replace one of the divs with an <a> tag instead, but found out that I am not allowed to add <a href> tags inside that div. I have something like this below. Is there a way I could make this work?
thanks
All-Star
57854 Points
15488 Posts
Re: wrapping elements inside <a> tag?
Jun 10, 2017 03:55 PM|bruce (sqlwork.com)|LINK
Star
8670 Points
2882 Posts
Re: wrapping elements inside <a> tag?
Jun 12, 2017 06:41 AM|Cathy Zou|LINK
Hi maggiemays
As bruce said, you may not wrap A elements with larger A elements.
The 'a button' bit is a list of tags. You can't have an a tag inside another a tag
For more information, pleaser refer to the following link:
https://stackoverflow.com/questions/6393827/can-i-nest-a-button-element-inside-an-a-using-html5
Beside, why you need to wrap div with ‘dd-lnks’ class inside <a> element?
Best regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.
Member
38 Points
338 Posts
Re: wrapping elements inside <a> tag?
Jun 12, 2017 05:59 PM|maggiemays|LINK
thanks Cathy, I forgot to close the <div class="dd-lnks"> around the title ('about')... that's why it's there. thanks for the link.
Star
8670 Points
2882 Posts
Re: wrapping elements inside <a> tag?
Jun 13, 2017 03:09 AM|Cathy Zou|LINK
Hi maggiemays
Are you solved your problem or confusion.
If not.
What’s your purpose of using the following code.
Perhaps, we could provide a alternative way of that.
Best regards
Cathy
Please remember to click "Mark as Answer" the responses that resolved your issue.
If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.