Hi,
I’ve been trying to learn how to create navigation bars where there is are elements aligned on the left and another on the right.
Is this the correct way? Any feedback would be great:
Navbar Code
Thanks in advance,
M
Hi,
I’ve been trying to learn how to create navigation bars where there is are elements aligned on the left and another on the right.
Is this the correct way? Any feedback would be great:
Navbar Code
Thanks in advance,
M
Yeah, that works fine.
I kind of hate to steer you towards this site but they do have a good short example of exactly what you are doing https://www.w3schools.com/css/tryit.asp?filename=trycss_navbar_horizontal_black_right
Floats are kind of ‘old school’ but you solved your problem with minimal effort and the code is easy to understand at a glance.
There are lots of introductory tutorials / articles on navigation bar layout. You might check a few out to get a feel for all the possibilities. I usually reach for flexbox for things like this. Placement options beyond simple left / right get easier with flexbox (centering, spacing, etc) but there are other options too.
Thanks for taking the time for looking.
Yes, was looking at flexbox as well, but always like to learn things from the ground up it’s the way I learn.
Appreciate your feedback.
You’re welcome.
Good approach. Besides, floats aren’t exactly dead. You’ll be seeing those in the wild.