Nelson Tan 0 Posted December 8, 2017 Report Share Posted December 8, 2017 (edited) Hi, in this hover dropdown menu example (https://www.w3schools.com/howto/tryi...ropdown_navbar), the menu words are aligned left starting from 'Home'. Where do you place the 'text-align: center' statement in the coding to shift all the words towards the center of the navigation bar? Somehow it isn't as simple as it seems to me. For your benefit, I attach sample coding in example.html. Thanks for your advice. example.html Edited December 8, 2017 by Nelson Tan Quote Link to post Share on other sites
Ingolme 1,035 Posted December 8, 2017 Report Share Posted December 8, 2017 Since they use the float property text align has no effect. To center the menu you will have to remove the float property and set the display of the menu items to inline-block. Then you can use text-align on the container. Quote Link to post Share on other sites
Nelson Tan 0 Posted December 8, 2017 Author Report Share Posted December 8, 2017 Hi Ingolme, thanks for replying. I'm almost there. Right now, the non-dropdown words and the dropdown words do not align vertically. Can you or anyone please take a look at the attachment example2.html? Thanks. example2.html Quote Link to post Share on other sites
dsonesuk 929 Posted December 8, 2017 Report Share Posted December 8, 2017 https://www.w3schools.com/code/tryit.asp?filename=FM0L3K29DJO4 Quote Link to post Share on other sites
Nelson Tan 0 Posted December 8, 2017 Author Report Share Posted December 8, 2017 Hey thanks, dsonesuk. Problem solved. Have a good weekend. Quote Link to post Share on other sites
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.