So I'm working on the email verification part of my website. And I came across an unexpected error.
When I send an email to a user. I write it like this but for some reason the links aren't clickable.
How can I make my emails have clickable links?
<html>
<head>
<title>Title</title>
</head>
<body>
I'm a link to somewhere
</body>
</html>
You should had : http:// to your link.
<html>
<head>
<title>Title</title>
</head>
<body>
I'm a link to somewhere
</body>
</html>
If you dont it sends you to:
http://www.mywebstie.com/www.google.com
Of course mywebsite is just a exemple.
Have a Nice Day ;).
Related
So I started learning HTML today and the first file I coded does not come up in Chrome after being formatted. This is what the code looks like:
<!DOCTYPE html>
<html>
<head>
<title>Nikolay's Website</title>
</head>
<body>
</body>
</html>
And after I tried opening the file, which is of type "Chrome HTML Document" btw (thought it might help as info), it shows a blank page with no heading. Even if I remove the code and type "Hello World" it would still show a blank page in my browser.
HTML page should have the following default structure. Please refer this link https://www.w3schools.com/html/default.asp
<!DOCTYPE html>
<html>
<head>
<title>Nikolay's Website</title>
</head>
<body>
Hello World
</body>
</html>
I copied code to insert on my BigCartel shop so I can get my products to upload to my Pinterest account. I'm looking for the "Head" section in my code and can't find it. I'm not much of a coder, but I think I can copy and paste if I knew where to put it :-).
Please advise.
Thanks,
Sharon
www.rollershirts.com
Evening Sharon,
The "head" of your code that you're referring to would most likely be the <head> tag in the html.
A very basic website would look like this:
<!DOCTYPE html>
<html lang="en">
<head>
<title>Title of the document</title>
</head>
<body>
<h1>This is a heading</h1>
<p>This is a paragraph.</p>
</body>
</html>
As you can see, the <head> tag is right after the first <html> tag.
If your website does not have this tag, simply add it to the proper area. (Within the <html> tag but before the <body> tag.)
Paste the code you said you got like the example I give below:
<head YourCodeStringHere>
I am using the following code to attempt to place an image of myself into my personal website:
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
</head>
<body>
<center>
<img src = "/photos/mainphoto.jpg" alt = "Test Image"/>
<h1>My Page</h1>
<hr />
<p> To be updated.</p>
</center>
</body>
</html>
The photos directory is in the same directory as the html page. I have tried placing the photo in the same directory as the html page and it doesn't work. I have tried using .JPG instead of .jpg. I have tried executing the code without the alt tag. I have tried using backslashes instead of forward slashes in the file path. I have looked for typos in the filename and there are none. I feel like my current code should be working with no problems. But the image will absolutely not show up. Any ideas or help would be greatly appreciated.
EDIT: I have corrected the code above to fix an elementary mistake, namely including the body inside of my head instead of separating the two. The picture still does not show.
The HTML structure needs to be:
<html>
<head>
</head>
<body>
</body>
</html>
You are putting the body tag inside the head tag.
Also, if the images directory is in the same one than the html, you need to remove the first slash, just use photos/mainphoto.jpg
So you can try:
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
</head>
<body>
<center>
<img src="photos/mainphoto.jpg" alt="Test Image"/>
<h1>My Page</h1>
<hr />
<p> To be updated.</p>
</center>
</body>
</html>
Also I recommend you not to use any spaces before or after the equal signs, these are good practices.
Well, your code is like this
<!DOCTYPE html>
<html>
<head>
<title>My Page</title>
<body>
<center>
<img src = "/photos/mainphoto.jpg" alt = "Test Image"/>
<h1>My Page</h1>
<hr />
<p> To be updated.</p>
</center>
</body>
</head>
</html>
You have <body> element inside your <head> element.
It should be like this
<!DOCTYPE html>
<html>
<head>
</head>
<body>
<center>
<img src = "/photos/mainphoto.jpg" alt = "Test Image"/>
<h1>My Page</h1>
<hr />
<p> To be updated.</p>
</center>
</body>
</html>
And for that image, the address must start from your html file.
So if you have structure like this
web/
index.html
photos/
cutePuppy.png
You will have <img src="photos/cutePuppy.png" alt="Cute puppy">
Try using the full path of the image listed in its properties.
FIXED
In the Windows 10 filesystem, the picture file extensions are evidently hidden. I had named the picture "mainphoto.jpg", without realizing that the Windows 10 filesystem had already automatically added a .jpg extension, which was hidden in the file structure. Therefore, the name of the file being referenced was actually "mainphoto.jpg.jpg".
Apologies for the silly mistake, and thank you to everybody who offered suggestions!
Does it show as 404(not found) in the web inspector of the browser you are using. Chances are that the folder with the image and possibly the image it self don't have permissions great enough to allow access. You will have to change the permissions via terminal or possible in the editor(IDE) you are using.
I have an HTML file that has several links to the same URL. Is there a way to specify the URL once, instead of in each anchor? Currently, if I change the URL, I manually change it in each anchor. I would consider a Javascript solution, but would prefer something a bit simpler and lightweight. Here is a code sample with two links to google.com:
<HTML>
<HEAD>
</HEAD>
<BODY>
<P>
Preferred search engine
</P>
<HR>
<P>
Google
</P>
</BODY>
</HTML>
You can use the <base> element:
For example:
<!DOCTYPE html>
<html>
<head>
<meta content="text/html; charset=utf-8" http-equiv="Content-Type">
<title>Untitled 1</title>
<base href="https://www.google.com/">
</head>
<body>
<p>
Preferred search engine
</p>
Google
</p>
</body>
</html>
Any links you specicfy will be relative to the base URL, so if you had Preferred search engine the link would be https://www.google.com/foo.html
You have to use javascript to do that. jQuery will do nicely:
$(function() {
$('a').attr('href','https://www.google.com');
});
Then you can call the same thing if the URL changed.
If you don't want to use jQuery this is the equivalent js code:
<script>
function ChangeHref(){
document.getElementById("a").setAttribute("onclick", "location.href='https://www.google.com'");
}
</script>
You cal trigger the changehref from anywhere you want.
BTW: the above function is equal to document.ready.
JSBIN: http://jsbin.com/mucume/edit?html,output
JSFiddle: http://jsfiddle.net/ksvq4buc/
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>JS Bin</title>
</head>
<body>
Google
<br/>
Yahoo
</body>
</html>
In both the examples above, clicking on the links does not do anything. Why are anchor hyperlinks disabled on these sites
You need to open the browser's console to see the reason. Both sites show:
Refused to display 'https://www.yahoo.com/' in a frame because it set
'X-Frame-Options' to 'DENY'.
For more information on that, see https://developer.mozilla.org/en-US/docs/Web/HTTP/X-Frame-Options