i made this page yesterday and href links doesn't work...
HTML and CSS source here: https://titanpad.com/jmAHmU3GyI
I may not understand exactly what you're asking, but the href attribute belongs inside an anchor tag, like so:
<td>Link</td>
Specification: http://www.w3schools.com/tags/att_a_href.asp
Demo: http://jsfiddle.net/0mtto06n/
You are using the href attribute on <li> elements which is unfortunatelly not going to work. To create links use Link text
Read more here:
about a tag
Related
I was checking a navbar markup example to use in a website, when I found the attribute "data-unsp-sanitized" placed in HTML anchor tags like this:
<a href="#" data-unsp-sanitized="clean">
I searched over Stack Overflow and Google, and surprisingly ended with no explanations of what this attribute does or why it is there.
It means your anchor tag has been assigned additional information clean. It may be used by CSS or Javascript. More about HTML data-* attributes you can read here.
So I'm working on a website
<img src="Images/PaintEverythingPreview.png" herf="Pages/PaintEverything.html">
<p> - <a herf="Pages/PaintEverything.html">
Paint Everything
</a> - </p>
and the code here isn't working, none of the links work! I've coded a little program on my website, and this is supposed to take you to it, but it's not working, please help!
Use href instead of herf.
Paint Everything
HTML Tags
The correct way to include a link in your HTML is to use the href element (you mis-spelt it as herf.
Secondly, you cannot use href inside an img tag as it's not valid HTML. Instead, you should nest the img tag inside the link.
Update your code to this:
<a href="Pages/PaintEverything.html">
<img src="Images/PaintEverythingPreview.png">
</a>
<p>
Paint Everything
</p>
To validate (check) your HTML in the future, try the W3C Validator
error writing the attribute href.
Paint Everything
error in attribute href in img tag (not exists):
<img src="Images/PaintEverythingPreview.png" herf="Pages/PaintEverything.html">
html tag reference: HTML tags list
Change herf to href and enclose the img in <a> tags to make the image a clickable link.
<img src="Images/PaintEverythingPreview.png">
Firstly you need to remove href from the image tag, since you cannot put a href in an <img> tag.
Secondly you need to check if the path/link to which you want to redirect to, is correct or not.
I have updated your code and let me know if this is what you are looking for.
<img src="Images/PaintEverythingPreview.png"><p> - Paint Everything - </p>
I am making a page where I want the links from my navigation to jump to their corresponding anchor tags in the page, however when I click the links the page does not jump at all.
The code for my page is here:
https://github.com/harlanplatz/harlanplatz.github.io/blob/gh-pages/index.html
I have worked with anchor tags before and am not sure why this may not be working.
OK Thanks Justin, it looks like you are just missing some linkage in your named anchor (<a></a>) tags.
Remember that you must name your destination anchor <a> tag. So:
<a name='example'><h1>Cool story bruh</h1</a>
Then, to link to it, make sure you use #anchorname in your link <a> tag. So:
<a href='#example'>Read a cool story</a>.
So you are matching the part after the # in your link href to the name attribute in the anchor you want to jump to. I don't see this going on in your HTML.
So I have a box on the right side of the page which when clicked on different titles will take to different news articles on the page though I also have it so when articles within the website titles are clicked upon on the page that they will be taken to the source. At the moment though neither are working what is going wrong?
html
<a name="Anchor1">News Article</a>
Use id attribute inside the link to have the same effect as name attribute
<a id="Anchor1" href="http://newsarticle.com">News Article</a>
Simply add an id attribute to the link:
<a id="foo" href="http://newsarticle.com">News Article</a>
Then link to it like this:
link to foo
Nested <a> elements are forbidden in HTML syntax.
Browsers effectively enforce this restriction in their parsing rules.
Example:
if you have a link ,
a<a href="b.html">bc</a>
Browsers will parse it as,
a b c
Reference: Nested links are illegal.
I`ve seen on various websites, some links appear like this: http://www.myserver.com/page.html#something and when I click on it, it just moves to another portion of the page.
I want to know how to do this. Is it only the URL of the <a href> atrribute?
The fragment at the end of the url coresponds to an ID on the page you're visiting.
If in my page I have a section such as:
<div id="comments">
...
</div>
Then I can take the user to this section by attaching #comments to the pages URL
(http://www.example.com/page.html#comments)
Link to comments
Update
Some of the other answers here correctly point out that you can create an anchor with a name attribute as: <a name="example"></a>.
Although this is technically correct, it's also a very antiquated way of doing things and something I'd recommend you avoid. It's very 1997 as some might say :-)
The text after the hashtag corresponts with an anchor on the page. An anchor is a hidden element on the page which you can link to.
Think for example about a large page with an to top link in it
To create an anchor use:
<a name="C4"></a>
To link to it use: Text
Or you can even link to an id of an element
Check out: links (aka anchors)
Also note that you can use <a name="something"></a> or <a id="something"></a>
or using divs <div id="something"></div>
This is a link to a bookmark on the given page (or even just #something on the current page).
To make it work, you need to define something. You can do this using the name attribute of an <a> tag.
http://programming.top54u.com/post/HTML-Anchor-Bookmark-Tag-Links.aspx