Centering links in menu |
Centering links in menu |
Legless |
Feb 2 2018, 05:19 AM
Post
#1
|
Newbie Group: Members Posts: 16 Joined: 6-January 17 Member No.: 26,256 |
Hi guys,
I'm trying to implement some code I found on w3schools for a responsive menu. This is the code: https://www.w3schools.com/howto/howto_js_to..._responsive.asp It appears to work well, but the problem I'm having, is that I can't get the links to be centered across the page. I've tried removing the float: left / adding divs inside divs with percentages / margin: 0 auto, etc. etc., but I'm getting nowhere. I wonder if someone could help me sort out this problem? They have a sort of jsfidddle type page here: https://www.w3schools.com/howto/tryit.asp?f...ryhow_js_topnav Many thanks. |
Legless |
Feb 7 2018, 05:42 AM
Post
#2
|
Newbie Group: Members Posts: 16 Joined: 6-January 17 Member No.: 26,256 |
This was the fix...
CODE @media screen and (max-width: 600px) { .topnav a:not(:first-child) { display: none; } .topnav a { float:left; } .topnav a.icon { float: right; display: block; } } |
Lo-Fi Version | Time is now: 10th June 2024 - 05:14 AM |