I have the following code in my html. When I click on the icon I want to be taken to my websites facebook account.
<li><a href="www.facebook.com/mywebsitename"><i class="fa fa-facebook" aria-
hidden="true"></i></a></li>
However instead I get my webpage without any css and the url changes to the following url. Why is this?
https://mywebiste.com/www.facebook.com/mywebsite
The URL is considered as a directory Path. try to replace
href="www.facebook.com/mywebsitename"
to
href="https://www.facebook.com/mywebsitename"
Your URL should be starting with a scheme:
<a href="https://www.facebook.com/mywebsitename">
See more here: What_is_a_URL
This happens because you didn't write the beginning of the line address. He directs you to your own page in this project because he doesn't know where to go. Use https://.
<a href="https://www.facebook.com/mywebsitename">
Related
I have been running a localhost website with react.js while I am building a website and when I am trying to link to an external site (e.g. youtube) it ends up going to a link like this:
http://localhost:3000/www.youtube.com
while I am trying to go to:
https://www.youtube.com
I am using this to get my link:
<a href='youtube.com' target='_blank' rel='noreferrer'>YouTube</a>
You need to specify the protocol, or put // at the start of the href attribute. For example:
Try using a protocol like http:// or // to external links like this :
<a href='https://youtube.com' target='_blank' rel='noreferrer'>YouTube</a>
See this good answer on SO : https://stackoverflow.com/a/8951636/6028607
Try this:
<a href='https://youtube.com' target='_blank' rel='noreferrer'>YouTube</a>
It's easy to use HTML to open a link in a new tab. You just need an anchor () element with three important attributes:
The href attribute set to the URL of the page you want to link to.
The targetattribute set to _blank, which tells the browser to open the link in a new tab/window, depending on the browser's settings.
The rel attribute set to noreferrer noopener to prevent possible malicious attacks from the pages you link to
try using this
youtube
Download omisphere
This is a hyperlink that I made because non of my other ones were working and this still didn't work.
Could it be my css?
<a href= is what tells the website "what follows is a link".
everything between the quotes "http://example.com/download/omisphere.txt" is the URL to the file and the name of the file.
" download> is telling the webpage that when the link is clicked, download the file.
Download Omisphere is the part they click on.
Put it all together and you get:
<a href="http://example.com/download/omisphere.txt" download>Download Omisphere</a>
If this were a real link it would down the file omisphere.txt from http://example.com/download/
Without seeing what html and css you have so far, it's hard to know what you're talking about.
So i have a HTML file in my cPanel File Manager and i want to edit it.
Here's an example
My HTML Line
<a class="/">My Home</a>
My HTML Line (Edited)
<a class="/">Home</a>
I want to see the preview,so i type in my website url on my browser. The HTML was edited successfully in HTTP.
But when i go to HTTPS,it doesn't change at all. It's still says "My Home". Does HTTPS effect this kind of stuff? Need Help Please :)
Thank You
You might have another www-root for https than for http...
I am using a local server for my applications and sometimes when I created a button or a link to another page in a new tab, it turns out to not working properly. It's not always like this, but sometimes, might sound silly. I give example below.
Let's say my application is **programmingworld** which exists in www folder, then in index.html file, I create a link for a button like this
Download Codes</div>
When I open it in a browser and click the button, sometimes it goes to http://localhost/programmingworld/www.google.co.uk where nothing is displayed on the page. It supposed to be www.google.co.uk in the new tab where I can see the google homepage.
Can you please tell me why?
You should write:
Download Codes</div>
If you didn't write http:// at the the beginning of the hyperlink, it will be search you your local directories or files.
To make sure that the link goes to where you intend and not where it goes try adding // or http://.
Example:
Google
or
Google
With // it will try http and https.
You're missing https:// before www.google.co.uk
So you're markup should look like this:
<a href="https://www.google.co.uk">
<div class="button" id="button=popup">Download Codes</div>
</a>
you can also do it like this (no https):
<a href="//google.co.uk">
<div class="button" id="button=popup">Download Codes</div>
</a>
Because you haven't included the protocol in your URL. it must start with either http:// or https://
Also, remove the div from inside the anchor tag.
Your question suggests that you need to do a little bit more testing on basic html.
I would most definitely suggest using https://
I've had similar problems such as that, and in order to fix them try adding https.
I am trying to parse a website.This is what Im doing I download the source and traverse the data using nokogiri and get the information I needed like links, content, etc. I already have the script for getting the data. But I stumbled a problem when the link only works when you click on it on a live site.
This is the example source I'm trying to traverse.
<div class="story-item-content group">
<div class="story-item-details">
<h3 class="story-item-title">
How NOT to fix your computer, part 2.
<span class="external-link-icon"></span>
</h3>
<p class="story-item-description">
zug.com <a href="/news/technology/how_not_to_fix_your_computer_part_2" class="story-item-teaser">— After you read this you should understand what not to do.
<span class="timestamp">21 hr 59 min ago</span></a>
<a class="crawl4link" href="http://crawl4.digg.internal/permalink/view/how_not_to_fix_your_computer_part_2">View in Crawl 4</a>
</p>
</div>
So in line 4. the link href="/story/r/how_not_to_fix_your_computer_part_2
only works in a live site. When I download the source and click the link. It won't work. I'm guessing the link is save in the server. Any idea how do i get the full link?. I was thinking of having a script that clicks that link, in that way I can get the working link. Any idea how to do this? thnx
that url is a relative url,
so if the website you're at is:
http://mywebsite.com/index.html
then your full link is
http://mysebsite.com/story/r/how_not_to_fix_your_computer_part_2
It's a relative link, relative to the the root directory of the website. Just prepend domain (i.e. example.com/story/r/how_not_to_fix_your_computer_part_2).
The reason clicking the link won't work is that the href value is a relative one... relative to the location that the file is stored on. Once you download the page to your local computer it is no longer relative to the original domain, the browser will assume it is looking for a file at http://localhost/story/r/how_not_to_fix_your_computer_part_2. And since there isn't a file or a resource at that URL, it fails.
What you want to do is change the href value to an absolute url by prepending the original domain (i.e. digg.com/story/r/how_not_to_fix_your_computer_part_2). Then it will work when you click it from your local drive.
You won't need to worry about the numbers added on to the url when it finally resolves, that will be handled by the resource at the digg.com/story/r/how_not_to_fix_your_computer_part_2 url.