The Web Design Group

... Making the Web accessible to all.

Welcome Guest ( Log In | Register )

> Current/Active Nav Bar Item Not Working?
icanswim70
post May 24 2019, 12:41 PM
Post #1


Newbie
*

Group: Members
Posts: 12
Joined: 23-May 19
Member No.: 26,898



Hey everyone,

As the name suggests I have the respective classes coded to highlight the current page on the Nav bar, but it isn't working whatsoever. Is it missing something?

*NOTE* This website is coded with HTML and CSS exclusively and would like to avoid Java if possible.

Thanks

I hope the screen shot attached...

This post has been edited by icanswim70: May 24 2019, 12:44 PM
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
 
Reply to this topicStart new topic
Replies
pandy
post May 27 2019, 07:12 PM
Post #2


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,366
Joined: 9-August 06
Member No.: 6



QUOTE(icanswim70 @ May 24 2019, 07:41 PM) *

As the name suggests I have the respective classes coded to highlight the current page on the Nav bar


Nope. I don't see anything like that.

I wonder if you have misunderstood a:active? It doesn't mean a link to the current page. It's means the state a link is in for a brief moment exactly when it's clicked. If you just click as you normally do it's so brief it's hard to see.

But if you make it extreme...

CODE

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
"http://www.w3.org/TR/html4/strict.dtd">

<html>

<head>
<title>a:active</title>

<style type="text/css">
body      { background: black }
a         { color: white; font: bold 300% Verdana, sans-serif }
a:active  { color: red }
</style>

</head>



<body>

<p>
<a href="http://htmlhelp.com">The WDG</a></p>

</body>
</html>

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
Christian J
post May 28 2019, 06:07 AM
Post #3


.
********

Group: WDG Moderators
Posts: 8,216
Joined: 10-August 06
Member No.: 7



QUOTE(pandy @ May 28 2019, 02:12 AM) *

Nope. I don't see anything like that.

In particular, this selector:

CODE
li a.current

won't do anything by itself, it's just an ordinary CLASS name (and there is no link using that CLASS in the HTML anyway).

QUOTE
I wonder if you have misunderstood a:active? It doesn't mean a link to the current page. It's means the state a link is in for a brief moment exactly when it's clicked. If you just click as you normally do it's so brief it's hard to see.

Yes, it's mostly when a page takes time to respond you may notice.

User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post
pandy
post May 28 2019, 06:53 AM
Post #4


Don't like donuts. Don't do MySpace.
********

Group: WDG Moderators
Posts: 18,366
Joined: 9-August 06
Member No.: 6



Or if you use really flashy colors. tongue.gif
User is offlinePM
Go to the top of the page
Toggle Multi-post QuotingQuote Post

Posts in this topic


Reply to this topicStart new topic
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

 



- Lo-Fi Version Time is now: 15th September 2019 - 02:51 AM