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 query

Featured Replies

I am really still a bit of newbie to CSS but am using it more and more for navigation menus etc. I am putting together a new website just now and have a query regarding the menu - the link below takes you to my sample ......

 

http://www.swslg.org.uk/test.htm

 

When the 'How to Contact Us' link is rolled over, the rollover colour does not completely fill the last bit of the row, to the right.

I would like it to show this colour right to the edge in the same way that the 'Homepage' link rollover colour meets the left hand edge of the table. I thought that using "width=100%" setting in the CSS would have achieved this but obviously I am missing something else. I've tried fiddling around with the Padding options but that hasn't helped.

 

Any advice appreciated please. :rolleyes:

I am really still a bit of newbie to CSS but am using it more and more for navigation menus etc. I am putting together a new website just now and have a query regarding the menu - the link below takes you to my sample ......

 

http://www.swslg.org.uk/test.htm

 

When the 'How to Contact Us' link is rolled over, the rollover colour does not completely fill the last bit of the row, to the right.

I would like it to show this colour right to the edge in the same way that the 'Homepage' link rollover colour meets the left hand edge of the table. I thought that using "width=100%" setting in the CSS would have achieved this but obviously I am missing something else. I've tried fiddling around with the Padding options but that hasn't helped.

 

Any advice appreciated please. :rolleyes:

 

Hi fubar,

 

I'm not an expert in CSS (not yet anyway), but here goes....

 

I don't think you need to have the float in your #navcontainer ul li a style as your are correctly displaying the li elements inline (so that they line up horizontally and not vertically). You might need to add a display:block to your a elements within the ul li to make the hover work correctly.

 

In fact (and I'm guilty of this too), the ul doesn't need to be contained within a div as it's a block level element anyway, you can just use the navlist id that you've given to the ul to reference it and it's sub-elements within the css.

 

Another little tip, try not to use tables for layout, it's not good practice.

 

Other and more knowledgeable members on here may prove me wrong.

 

HTH.

i had this problem once and fixed it by making each button the same width - therefore if my navbar was 760px wide, i'd divide that by the number of buttons and apply this width to my buttons

 

might be better ways though ^_^

I think the problem is that your li has no set width and so it's the size of the text length? or maybe the ul has a right margin?

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.