# What does Dead Link on HTML and CSS do?

**URL:** <https://forum.freecodecamp.org/t/what-does-dead-link-on-html-and-css-do/164550>\
**Category:** General\
**Created:** [December 19, 2017, 11:07pm UTC](https://forum.freecodecamp.org/t/what-does-dead-link-on-html-and-css-do/164550 "2017-12-19T23:07:45Z")\
**Posts on this page:** 1\
**Showing post:** 7

<div class="post-metadata">

**Author:** ![IsaacAbrahamson](https://sea3.discourse-cdn.com/freecodecamp/user_avatar/forum.freecodecamp.org/isaacabrahamson/32/30882_2.png) [@IsaacAbrahamson](https://forum.freecodecamp.org/u/IsaacAbrahamson)\
**Post date:** [December 20, 2017, 5:00pm UTC](https://forum.freecodecamp.org/t/what-does-dead-link-on-html-and-css-do/164550/7 "2017-12-20T17:00:02Z")

</div>

There seems to still be some misunderstanding, so let me give you an example:

> **[BJzRRQ](https://codepen.io/isaacabrahamson/pen/BJzRRQ)**
>
> ...

The first link does not have a hashtag in it. It is a completely dead link. When you click it, it reloads the page (in this case the window - you will see it flash).

The second link is a dead link, but it has a hashtag in it. It is a dead link, but it does not refresh the page.

The third link takes you to a section at the bottom of the page.

* * *

> [@Bego96](#):
>
> So does that mean if # is alone link wont work and wont load?

I am not sure what you mean, did my example clarify this?

> [@Bego96](#):
>
> I read it just gets you back to top of page if you click on it, nothing else happens, right?

That is correct, and that it is why it does not refresh the page. If you don’t have the hashtag in there, the link will reload the whole page, but if you do put it in there, it will link to the top and not reload page. If you want a more specific answer, an empty string is not a URI, and according to the spec:

> A URI reference [i.e. href] that does not contain a URI [an empty string is not a URI] is a reference to the current document. In other words, an empty URI reference within a document is interpreted as a reference to the start of that document, and a reference containing only a fragment identifier is a reference to the identified fragment of that document.

Here is more information if you want to read:

> <https://stackoverflow.com/questions/5637969/is-an-empty-href-valid>

> <https://stackoverflow.com/questions/4855168/what-is-href-and-why-is-it-used>

Basically, both are valid for dead links. Using a hashtag is preferred however as it lets you style the link, as `a:link`will not work for an anchor element that does not have a URI.

> [@Bego96](#):
>
> And this part of the page? How do we define it in href with #? (A href=’ ‘#blabla’ '\>blabla example)

Normally, you define it like this:

```html
<a href="#about"></a>
<div id="about"></a>

```

And the hash links to the id section you specify.

> [@Bego96](#):
>
> So from my understanding we only put # symbol to href while we find or make to which site to link it to? Like link is there but it wont direct you to that link untill you put the link (web adress) to href?

Correct. You can leave the href blank, but putting a # is common practice. Putting the hash prevents the page from reloading and let’s you style the link with css.

---

_[View the full topic](https://forum.freecodecamp.org/t/what-does-dead-link-on-html-and-css-do/164550)._
