Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Current page link style

Featured Replies

I am ripping my hair out because I can't find a way to style the link for the current page I am on, I am sure it's pretty straight forward. Here's my Nav css:

 

/*   TOP NAV   */

.Links {
font-size: 13px;
width: 100%;
overflow: hidden;
}

.Links ul {
float: left;
width: 95%; 
height: 24px;
margin: 38px 0px 0px 0px;
padding-top: 77px;
}

.Links ul li {
display: inline;
text-align: right;
}

.Links ul li a {
float: right;
height: 24px;
_height: 20px;
font-weight: bold;
color: #555555;
text-decoration: none;	
margin: 0px;
padding: 0px 12px 0px 12px;
}

.Links ul li a:visited {
color: #555555;
text-decoration: none;	
}

.Links ul li a:hover {
color: #9b0000;
text-decoration: underline;
}

 

I want it so the current page I am viewing, the link text in the nav will turn #9b0000.

 

Thank guys, I'm still learning.

is it a dynamic link or a html one? if its done via a cms, then change the code to add in the following, or if html site, add to each link of that page

 

html

<a class="select" href="#">Link text</a>

 

css

a.select:link {
color:#9b0000;
}

  • Author

It's just a HTML link to my pages.

index.html

services.html

contact.html

etc...

 

Thanks so much, but it didn't seem to work.

I will where was I supposed to add that CSS?

Hi christian,

 

you need to specify a separate class for your current links eg .LinksCurrent then place all of your styling for that state in that class.

 

one tip is to set cursor:default; in the current link state as it keeps the link clickable (which is useful sometimes to refresh/reset etc) but removes the little hand cursor link prompt.

 

A good PHP exercise is calling your main nav as an include and setting simple statements to do the work for you,

I haven't gone into detail as you might not be using PHP, let me know if it would be useful and I'll elaborate

 

 

Stevo

  • Author

I really don't get this, it's driving me crazy.

About 3 hours I've been trying and messing up.

  • Author

DONE!

I am a little slow, but I got through it. What worries me is I have to learn like ASP.NET and **** for uni and I can't even do basic CSS. :(

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.