I used the outline of the code from we3schools. My problem is that the first item on the navbar ends up smaller and not level to the rest of the items.
Even when I remove the dropdown “books” the first item is always slightly lower than the rest and I have no clue how to fix this error.
I couldn't get the code to align where it would let me publish so here is the github link (it's an html file with just the navbar and a css file with just the navbar portion in it).
LINK: https://github.com/Terrancesky/website/tree/main
CodePudding user response:
The code seem to be working fine when i copied it onto my codepen.io there is no disalignment and a slight improvement you can made is to use the following code for your dropdown
<select>
<option> item 1</option>
<option> item 2 </option>
</select>
CodePudding user response:
I think that you can wrap everything with a div, apply flexbox to it, and apply the align-items: center;
property to fix it. You can also add a 'gap' property for the spacing if you like.
Hope it helps!