EdS1945 Posted March 2, 2018 Share Posted March 2, 2018 I am using your navigation bar which suits my purposes perfectly. However, I wish I could display the menu items as centered on the page. Since there is no float center option, I would really appreciate any suggestion as how to solve this. Thank you Ed Link to comment Share on other sites More sharing options...
dsonesuk Posted March 2, 2018 Share Posted March 2, 2018 Text-aligned: center; applied to block non floated parent element with display: inline-block; applied to menu items. Link to comment Share on other sites More sharing options...
EdS1945 Posted March 2, 2018 Author Share Posted March 2, 2018 Thanks for your suggestion. Did you mean this: .topnav a { float: none; display: inline-block; color: #f2f2f2; text-align: center; padding: 1px 12px; text-decoration: none; font-size: 12px; That did not work for me. Link to comment Share on other sites More sharing options...
dsonesuk Posted March 2, 2018 Share Posted March 2, 2018 Well that depends if you added text:align: center; to the .topnav parent element like I said, and it is a block element that stretches the full width of IT'S parent you wish to centre the menu items to. Link to comment Share on other sites More sharing options...
EdS1945 Posted March 2, 2018 Author Share Posted March 2, 2018 Thanks again, however it's still no go! All menu items are still left aligned across the page. I copied the code from your site and added/modified as per you suggestions. I am attaching the html. Really appreciate your help Untitled-1.html Untitled-1.html Link to comment Share on other sites More sharing options...
dsonesuk Posted March 2, 2018 Share Posted March 2, 2018 (edited) You didn't follow my instructions, as I followed my instructions exactly, now that i have something to work with I.E. code and css, and it works fine. PS. ITS not my site, w3schools.com does not really have much to do with this forum, and i am just a member of this forum. Edited March 2, 2018 by dsonesuk Link to comment Share on other sites More sharing options...
EdS1945 Posted March 2, 2018 Author Share Posted March 2, 2018 I have nowhere implied that this is your site or that it is your code. I wrote to this forum because not being proficient with css myself, I was hoping to find someone here that is and that would help me. You volunteered to answer my post and I am grateful for that. Link to comment Share on other sites More sharing options...
dsonesuk Posted March 2, 2018 Share Posted March 2, 2018 7 hours ago, EdS1945 said: I am using your navigation bar 3 hours ago, EdS1945 said: I copied the code from your site Link to comment Share on other sites More sharing options...
EdS1945 Posted March 2, 2018 Author Share Posted March 2, 2018 The "your" refers to W3Schools.com and this being W3Schools Forum the association is logical. I did not mean you personally and if you took that way, I'm sorry. Link to comment Share on other sites More sharing options...
dsonesuk Posted March 2, 2018 Share Posted March 2, 2018 21 minutes ago, EdS1945 said: The "your" refers to W3Schools.com and this being W3Schools Forum the association is logical. I did not mean you personally and if you took that way, I'm sorry. I know that! The problem is NO ONE from w3chools.com replies to, or have anything to do with this forum, other than setting it up. and maintaining it if problem occurs, if that? So trying to get an answer from a developer who produced that menu theme/tutorial on w3schools is pointless. Refer to it as a w3schools.com menu and give link to it is more correct and helpful. As I could only provide a very limited answer to a very vague question. Link to comment Share on other sites More sharing options...
EdS1945 Posted March 2, 2018 Author Share Posted March 2, 2018 I get you point now. I am new to the forum and was not aware of the "loose" connection to W3schools. I really appreciate your help and time. Link to comment Share on other sites More sharing options...
Ingolme Posted March 2, 2018 Share Posted March 2, 2018 I don't find it unreasonable for somebody to join a forum belonging to a website and expect the website's owners to be actively participating. W3schools is actually an anomaly in this regard. Link to comment Share on other sites More sharing options...
dsonesuk Posted March 2, 2018 Share Posted March 2, 2018 1 hour ago, Ingolme said: I don't find it unreasonable for somebody to join a forum belonging to a website and expect the website's owners to be actively participating. W3schools is actually an anomaly in this regard. I agree, and I was just pointing out it is not the case for this forum. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now