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.

link hover

Featured Replies

Hi, I have my navbar link background image set in css and when i hover it changes to a different color image but what I want to do is keep the link background color image the same as the hover after I release the click and move the curser away from the link. The following site has the effect I mean, when you hover the links turn orange and the link stays orange after I click and move away.

 

http://www.westciv.com/style_master/index.html

 

Many thanks in advance,

 

Mark

mark.steen@live.co.uk

You need a variable on each page called something like 'currentPage', which changes the style of the 'active' link to your specification...

 

SO

<a href='#' <if currentPage = 'contactUs' then> style='background: #123456;</endif> >CONTACT BUTTON</a>

<a href='#' <if currentPage = 'aboutUs' then> style='background: #123456;</endif> >ABOUT BUTTON</a>

 

Does that make sense ??

or hard code ie:

 

<ul>

<li><span>page 1</span></li>

<li><a href="page2.html" title="">page 2</a></li>

</ul>

 

<ul>

<li><a href="page1.html" title="">page 1</a></li>

<li><span>page 2</span></li>

</ul>

 

or 1st post developed a bit...

 

<?php

while($links[$i])

{

if($i==$curpage) {$extracode=' class="current" '; }

else {$extracode=''; }

echo '<a href="..." title="" '.$extracode.'>...</a>';

}

?>

  • Author

Hi Satin,

 

Many thanks!

 

I had to amend your code slightly by taking off the > after 'then' one of the > after the 'endif' to get it to work but many thanks as I'd not have been able to get that far!

 

Cheers pal.

  • Author

Hi Mikejonsey,

 

I've only tried Satin's code so far and got it working but I will try your code in the future.

 

Many thanks!

 

Mark

Hi Satin,

 

Many thanks!

 

I had to amend your code slightly by taking off the > after 'then' one of the > after the 'endif' to get it to work but many thanks as I'd not have been able to get that far!

 

Cheers pal.

 

I wrote it in a generic code - not php, asp or anything - just to give you an idea ! By choice, I'd have written it in Coldfusion, but not many other people use that !

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.