Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
  • 한국 커뮤니티
0

Help adding a hyperlink to a banner

New Here ,
Jul 15, 2021 Jul 15, 2021

I have attempted moving the link around inside the div, moving the div in and out of the body.... copy and paste different peoples instructions i found on google, nothing works to get this banner image to hyperlink. I'm sure I am missing something simple. My code also has an error that says something needs to be closed and I can't for the life of me figure it out.

 

```<div id="RightFloatAds" style="right: 0px; position: fixed; text-align: center; top: 65px; background-color:black;color:black;border:5px solid black;" <a target="_blank" href="www.yahoo.com"><img src="banner1news.png" width="160" height="725" alt=""</a></div>```

TOPICS
Code , How to
464
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

LEGEND , Jul 15, 2021 Jul 15, 2021

Try adding the closing div and img tag > (see the 2 instances where they are missing, marked in red below):

 

<div id="RightFloatAds" style="right: 0px; position: fixed; text-align: center; top: 65px; background-color:black; color:black; border: 5px solid black;">

<a target="_blank" href="www.yahoo.com"><img src="banner1news.png" width="160" height="725" alt=""></a>

</div>



 

Translate
LEGEND ,
Jul 15, 2021 Jul 15, 2021

Try adding the closing div and img tag > (see the 2 instances where they are missing, marked in red below):

 

<div id="RightFloatAds" style="right: 0px; position: fixed; text-align: center; top: 65px; background-color:black; color:black; border: 5px solid black;">

<a target="_blank" href="www.yahoo.com"><img src="banner1news.png" width="160" height="725" alt=""></a>

</div>



 

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Jul 15, 2021 Jul 15, 2021

If you can as well move away from inline styles.

While not required in HTML5 it is nice to try keep symatic markup and fundementals in place when coding (for me anyway) so properly closing the image /> is what I would do.

Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 15, 2021 Jul 15, 2021

I tend to disagree with an unneccessary keystroke. What I find intriguing is the fact that `srcset` is never mentioned.

Wappler is the DMXzone-made Dreamweaver replacement and includes the best of their powerful extensions, as well as much more!
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Jul 17, 2021 Jul 17, 2021
LATEST

Why are you using so many inline styles in your markup?  Unless this is an email newsletter, CSS styles rightfully belong in an external or embedded stylesheet.  And if this is an email, you should use absolute urls to assets located on a publicly accessible server.

 

 

<div>
<a href="https://example.com/"><img src="https://dummyimage.com/500x100.jpg" alt="placeholder" title="Link to Example.com"></a>
<div>

 

 

Working example of code above:

placeholder
 
Nancy O'Shea— Product User, Community Expert & Moderator
Translate
Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines