html - How can I make my dropdown menu blocks center aligned under the parent item block? -


i have been trying edit dropdown menu sub-items centered beneath parent items. achieved centering find every time hovered on parent item reveal drop down menu, rest of menu fell bottom of dropdown menu.

here link sample, has coding on 1 side. thank in advance help! starting out css , html , no matter how many videos , tutorials watch , read, can't seem right :(

https://www.w3schools.com/code/tryit.asp?filename=feemwlifamao

try add vertical-align: top; .dropdown css so:

css

.dropdown {     vertical-align: top; } 

also on separate note remove width on .dropdown-content , instead put width on .dropdown make sure both same width , no wacky horizontal position changes on hover. solution make dropdowns position: absolute; , position them relative links. off-topic :)


Comments

Popular posts from this blog

How to understand 2 main() functions after using uftrace to profile the C++ program? -

c# - Update a combobox from a presenter (MVP) -

How to put a lock and transaction on table using spring 4 or above using jdbcTemplate and annotations like @Transactional? -