Printable Version of Topic

Click here to view this topic in its original format

HTMLHelp Forums _ Markup (HTML, XHTML, XML) _ Cannot complete <img src and <a href>

Posted by: htmlisneeded Nov 12 2018, 04:54 PM

Seeking assistance. The first item, I cannot seem to add a photo. When copying News.jpg from the picture properties in my computer than adding it to the HTML img src, the picture does not appear. The second issue is how can I add <a href="mailto:JohnDoe@Help.com">your anchor text</a> to the html <p><button class="button">Contact</button></p>?

Can any provide suggestions or help? The htlm I am attempting to complete is below.
</style>
</head>
<body>

<h2>Meet The Team</h2>
<p>We are led by a team of dedicated executives and colleagues around the world.
.</p>
<p><button class="button">Contact a Committee Lead.</button></p>
</div>
</div>
</div>
<div class="column">
<div class="card">
<img src=" News.JPG" alt="John Doe" style="width:100%">
<div class="container">
<h2>John Doe</h2>
<p class="title">Art Director</p>
<p>Some text that describes me lorem ipsum ipsum lorem.</p>
<p>JohnDoe@help.com</p>
<p><button class="button">Contact</button></p>
</div>
</div>


Posted by: Christian J Nov 12 2018, 05:37 PM

QUOTE(htmlisneeded @ Nov 12 2018, 10:54 PM) *

When copying News.jpg from the picture properties in my computer than adding it to the HTML img src, the picture does not appear.

The spelling must be identical, including case (.jpg vs .JPG).

QUOTE
The second issue is how can I add <a href="mailto:JohnDoe@Help.com">your anchor text</a> to the html <p><button class="button">Contact</button></p>?

See http://htmlhelp.com/faq/html/links.html#button-link (but note that mailto links only work if the user's computer has an email client installed, and not with online webmail services).



Posted by: pandy Nov 12 2018, 11:47 PM

I'm pretty sure the file name doesn't start with a space.

CODE
<img src=" News.JPG" alt="John Doe" style="width:100%">
         ^^^


The path must also be correct. Is the image in the same folder as the HTML?

Posted by: htmlisneeded Nov 13 2018, 12:02 PM

Thank you guys. I was able to add the HTML image. However I am still having trouble with linking an email address to the button html I have.

Hi Christan J, how can I add the below to the html to yesterdays post? I truely appreciate the help. Thank you.
6.7. How do I create a button which acts like a link?
This is best done with a small form:

<FORM ACTION="[URL]" METHOD=GET>
<INPUT TYPE=submit VALUE="Text on button">
</FORM>

Posted by: pandy Nov 13 2018, 01:17 PM

You can't. A can't be used with BUTTON.

You need to use a form. Like so.

CODE
<form action="mailto:JohnDoe@Help.com">
<button type="submit" class="button">your anchor text</button>
</form>


But you could just as well use an ordinary submit button. Or you could use JavaScript with BUTTON. But mailto is unreliable as it is, so no need to make it even more so by using JS.

Posted by: pandy Nov 14 2018, 12:57 PM

Hey, I remembered wrong. You can't put a link inside BUTTON, but it seems you can put a button inside a link. I could have sworn neither was allowed.

So you CAN do it like this.

HTML
<a href="mailto:JohnDoe@Help.com"><button type="submit" class="button">your anchor text</button></a>


Sorry for misleading you. blush.gif


Posted by: htmlisneeded Nov 28 2018, 11:39 AM

Thank you Pandy! It works!! Thank you for the follow up truely appreciate it!



Powered by Invision Power Board (http://www.invisionboard.com)
© Invision Power Services (http://www.invisionpower.com)