Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

drop-down menu positioning

Featured Replies

So I have this problem.. I was working on a drop down menu but when I hover over it moves all the content down. I suppose it's an issue with positioning, but I cannot locate the issue, so I'd need your help. Also the alignment of the sub-menu list items is off.


Here's the code:




Thanks for help


header nav ul li > ul{
	display: none
}

header nav ul li:hover > ul{
	display: block
}

header nav ul li > ul li{
	margin: 0;
	line-height: 50px;
	display: block;
	position: relative;
}

header nav{
	text-align: right;
	display: inline-table;
	line-height: 105px;
	font-family: 'Open Sans Light', sans-serif;
	font-size: 25px;
}

header nav a{
		font-family: 'Open Sans Light', sans-serif;
	font-size: 25px;
	color: black;
	margin-right: 15px;
}

header nav ul {
	position: relative;
}

header nav ul:after{
	content:'';
	clear: both;
	display: block;
}

header nav a:hover{
	color: grey;
}

header nav ul li{
	display: block;
	float: left;
}

header nav ul ul {
  padding: 0;
  position: absolute;
  top: 100%;
}

replace your css with the above. You needed to set header nav ul ul as absolute positioned so it didn't push the below content down when it appeared. And in order to be able to absolute position it I added position: relative to it's parent

Edited by realflairdesign

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.