DO NOT DEAL WITH THIS MEMBER
Aug 29, 2017 04:51 PM
(This post was last modified: Aug 29, 2017 04:53 PM by Tomodachi.)
I'm not a practiced programmer or familiar with much of HTML. Just need some quick help.
Code <h3 style="margin-top:50px;"> <a id="share3" style="font-weight:500;"> <img id="heartbeat" src="img/heart-full-red.svg" style="width:16px !important; height:16px !important; margin-right:5px; margin-bottom:-2px;" /> Click here</a></h3>
How would I make the "Click here" (which is a button by the way) redirect to a link? I tried <a href=""> but it broke the code.
Aug 29, 2017 04:53 PM
(This post was last modified: Aug 29, 2017 05:14 PM by Nachfolger.)
Onclick attribute. Below is an example of how you could use it. Place the "onclick" inside the element tags for the element you want to capture the onclick from. Pretty cool thing to use when "coding" on the fly.
Code <h3 onclick="location.href='www.google.com';"></h3>
Also, please avoid using inline-styling. It's absolutely aids.
Je t'aime
(Apr 22, 2022 04:39 PM)-Scrub Wrote: Jokes on you, I'm not smart enough to know what he's talking about.
Code <h3 style="margin-top:50px;"> <a id="share3" style="font-weight:500;">
<a href="http://www.google.com"><img id="heartbeat" src="img/heart-full-red.svg" style="width:16px !important; height:16px !important; margin-right:5px; margin-bottom:-2px;" /></a></h3>
DO NOT DEAL WITH THIS MEMBER
(Aug 29, 2017 04:54 PM)SIM-82498 Wrote: Code <h3 style="margin-top:50px;"> <a id="share3" style="font-weight:500;">
<a href="http://www.google.com"><img id="heartbeat" src="img/heart-full-red.svg" style="width:16px !important; height:16px !important; margin-right:5px; margin-bottom:-2px;" /></a></h3>
This turns it from this
https://i.imgur.com/BUX1xe2.png
to this
https://i.imgur.com/bdFtoKm.png
Aug 29, 2017 05:01 PM
(This post was last modified: Aug 29, 2017 05:02 PM by Nachfolger.)
(Aug 29, 2017 04:59 PM)Tomodachi Wrote: This turns it from this
https://i.imgur.com/BUX1xe2.png
to this
https://i.imgur.com/bdFtoKm.png I don't see why you're using an image inside a <a>, let alone all inside an H3. Which is for TEXT.
use what I posted.
Je t'aime
(Apr 22, 2022 04:39 PM)-Scrub Wrote: Jokes on you, I'm not smart enough to know what he's talking about.
(Aug 29, 2017 04:53 PM)Nachfolger Wrote: Onclick attribute.
Code <h3 onclick="location.href='www.google.com';"></h3>
Also, please avoid using inline-styling. It's absolutely aids.
Also, please avoid using inline-scripting. It's absolutely aids.
DO NOT DEAL WITH THIS MEMBER
Aug 29, 2017 05:05 PM
(This post was last modified: Aug 29, 2017 05:07 PM by Tomodachi.)
(Aug 29, 2017 05:01 PM)Nachfolger Wrote: I don't see why you're using an image inside a <a>, let alone all inside an H3. Which is for TEXT.
use what I posted.
Sorry. I have no experience with HTML whatsoever. I'm just trying to get by on using some ripped code.
Code <h3 style="margin-top:50px;">
<a id="share3" style="font-weight:500;">
<img id="heartbeat" src="img/heart-full-red.svg" style="width:16px !important; height:16px !important; margin-right:5px; margin-bottom:-2px;" /> Click here</a></h3>
<h3 onclick="location.href='www.google.com';"></h3>
I used it like this and it didn't do anything. Could you elaborate on where to put the code if it isn't too much trouble?
Aug 29, 2017 05:08 PM
(This post was last modified: Aug 29, 2017 05:15 PM by Nachfolger.)
(Aug 29, 2017 05:05 PM)Tomodachi Wrote: Sorry. I have no experience with HTML whatsoever. I'm just trying to get by on using some ripped code.
Code <a id="share3" style="font-weight:500;">
<img id="heartbeat" src="img/heart-full-red.svg" style="width:16px !important; height:16px !important; margin-right:5px; margin-bottom:-2px;" /> Click here</a></h3>
<h3 onclick="location.href='www.google.com';"></h3>
I used it like this and it didn't do anything. Could you elaborate on where to put the code if it isn't too much trouble? I understand you're new and still learning. Not hating on you for that, but I mean use some basic common sense when coding.
The <h3> tag I posted was an example of what you should use. Copy and paste this into where you have your stuff.
Code <a id="share3" style="font-weight:500;" onclick="location.href='www.google.com';">
<img id="heartbeat" src="img/heart-full-red.svg" style="width:16px !important; height:16px !important; margin-right:5px; margin-bottom:-2px;" />Click here</a></h3>
When a user clicks on the element where the "onclick" is assigned, the JavaScript code is executed. "location.href" changes the browser location to google.com (in this example)
Again, the reason I said to use some common sense was because it's an example of how to use it. I know you're new to HTML, but it shouldn't even require common sense to grasp that it was an example. Feel free to ask any other questions.
Also, the reason it didn't work was because you couldn't click on the <h3> element as it had no text inside it. If you were to write something inside there and then click it, it should work. Just a btw.
Je t'aime
(Apr 22, 2022 04:39 PM)-Scrub Wrote: Jokes on you, I'm not smart enough to know what he's talking about.
(Aug 29, 2017 05:08 PM)Nachfolger Wrote: I understand you're new and still learning. Not hating on you for that, but I mean use some basic common sense when coding.
The <h3> tag I posted was an example of what you should use. Copy and paste this into where you have your stuff.
Code <a id="share3" style="font-weight:500;" onclick="location.href='www.google.com';">
<img id="heartbeat" src="img/heart-full-red.svg" style="width:16px !important; height:16px !important; margin-right:5px; margin-bottom:-2px;" /> Click here</a></h3>
Code <h3 id="share3" style="font-weight:500;" onclick="location.href='https://www.google.com';">
<img id="heartbeat" src="img/heart-full-red.svg" style="width:16px !important; height:16px !important; margin-right:5px; margin-bottom:-2px;" />Click here</h3>
(Aug 29, 2017 05:08 PM)Nachfolger Wrote: I understand you're new and still learning. Not hating on you for that, but I mean use some basic common sense when coding.
Give him a break, he's not a second trimester fetus. We all started somewhere.
|