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.

css menu with images

Featured Replies

Hi!

Asking for some help from more experienced users.

 

I need to create active menu based on images.

Main idea: all menu elements have own picture. while put mouse cursor on any menu element picture changes. And the hardest for me - when you click any menu element, join certain page - all other pictures stay the same as at the beginning, apart one which is associated with this active at the moment page. It changes to a special one. This helps to understand what menu section is active at the moment.

 

Here is the code of css I used. I can't realize third step - link third image to an active page (website section).

.gmenu1 {
background: url('img1.jpg') 0 0 no-repeat; float: left; overflow: hidden; width: 180px; height: 270px; padding-right: 10px;
}
.gmenu1:hover {
background: url('img1a.jpg') 0 0 no-repeat; float: left; overflow: hidden; width: 180px; height: 270px; padding-right: 10px;
}
.gmenu2 {
background: url('img2.jpg') 0 0 no-repeat; float: left; overflow: hidden; width: 180px; height: 270px; padding-right: 10px;
}
.gmenu2:hover {
background: url('img2a.jpg') 0 0 no-repeat; float: left; overflow: hidden; width: 180px; height: 270px; padding-right: 10px;
}
.gmenu3 {
background: url('img3.jpg') 0 0 no-repeat; float: left; overflow: hidden; width: 180px; height: 270px; padding-right: 10px;
}
.gmenu3:hover {
background: url('img3a.jpg') 0 0 no-repeat; float: left; overflow: hidden; width: 180px; height: 270px; padding-right: 10px;
}

Edited by LordNighten

You can do it with matched pairs (each link has a class or id and each page body or menu parent div has a different class or id and when the link matches the page, the background changes), or you can use PHP.

 

Items 3 and 4 here http://www.wickham43...ghlighthome.php use background images and if you go from the home page to the services page you will see the orange tab change.

Edited by Wickham

  • Author

Item 4 looks reasonable and suitable for me. I just need to find out how to get page title in CMS I use.

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.