Skip to content Skip to sidebar Skip to footer

Links Not Displaying Links

I have created a navigation menu and was wondering why is it when I hovered over the li item containing the link the link does not display? Here is my Html containing the links <

Solution 1:

In the tag <a></a> try put the name of link... xD

<a>name of link</a>

Or if you like the field without text use the tag <li> inside tag <a>

<ahref="www.google.com"><liclass="nav-button"></li></a>

See this Example jsfiddle

Greetings.

Solution 2:

Anchor tags (<a>) are inline elements. Since they don't have any content they won't get rendered and you have only the background.

Fill them with information (e.g. the actual name of the link instead of a sprite) or use a non-breaking space entity &nbsp;anddisplay: block on your anchor tags. You can also combine both techniques.

Edit: Since you asked about a concrete example:

#nava { display:block; }
<ulid="nav"><liclass="nav-button"id="home"><ahref="Index.html">&nbsp;</a></li><liclass="nav-button"id="whatIs1031"><ahref="whatIs1031.html">&nbsp;</a></li><!-- ... --></ul>

However, I believe this is still not the best solution. I would come up with something lie this:

#nava {
    display: block; 
    padding-left: 15px; /* adjust this value to your image */background: url(sprite_a.png) no-repeat;  /* off-image */
}
#nava:hover{
    background: url(sprite_b.png) no-repeat;  /* on-image */
}
<ul><li><ahref="Index.html">Home</a></li><li><ahref="whatis1031.html">What is a 1031 exchange?</a></li><li><ahref="exchangeRequ.html">1031 Exchange Requirements</a></li><!-- ... --></ul>

Solution 3:

First of all your links have no css styling and no content and thus have no size, only your list elements have size. For the links to have the styling applied to them it should look like this:

<liclass="nav-button"><aid="fee"href="fees.html"></a></li>

To the question of nothing showing the image, that works absolutely fine for me. Except for the last item which is referenced wrong in the css:

#h-contactUs

should be:

#contactUs;

Solution 4:

<ulid="nav"><liclass="nav-button"><ahref="Index.html">Index</a></li><liclass="nav-button"><ahref="whatIs1031.html">whatIs1031</a></li><liclass="nav-button"><ahref="exchangeRequ.html">exchange1031</a></li><liclass="nav-button"><ahref="typesOfExchange.html">typesOfExchange</a></li><liclass="nav-button"><ahref="howToStart.html">howToStart</a></li><liclass="nav-button"><ahref="whyCLX.html">whyCLX</a></li><liclass="nav-button"><ahref="resources.html">resources</a></li><liclass="nav-button"><ahref="fAQs.html">faq</a></li><liclass="nav-button"><ahref="fees.html">fee</a></li><liclass="nav-button"><ahref="contactUs.html">contactUs</a></li></ul>

This allows you to hover over, click and be sent over to the 'href' link the specified button has been linked to.

Post a Comment for "Links Not Displaying Links"