Jump to content

I am having problem to create mega menu

Recommended Posts

Hi, I am having some problem while creating a mega dropdown menu. I want the mega-dropdown-content to be divided to 4 column and 3column will be for the menu and rest 1 column will be for an image. But this is not the expected result. Here is the code. Please tell how can I fix it? Thank you.

<!DOCTYPE html>
		<link rel= "stylesheet" href= "mega%20menu%20copy%20copy.css"/>
		<link rel= "stylesheet" href= "font-awesome-4.7.0/css/font-awesome.min.css"/>
.nav li,
.nav a,
.nav div{
	margin: 0;
	padding: 0;
	border: none;
.nav {
	position: relative;
.nav a {
	text-decoration: none;
.nav li {
	list-style: none;
a {
	color: white;
.menu-container {
	position: relative;
	width: 100%;
.mega-menu {
	position: absolute;
	width: 48%;
	left: 26%;
	height: 40px;
	background-color: red;
.nav > li {
	display: inline-block;
	height: 40px;
	font-size: 20px;
	font-weight: bold;
.nav > li > a {
	display: block;
	padding: 10px 10px;
	color: white;
	text-align: left;
	vertical-align: center;
	margin-bottom: 10px;
.mega-menu-content, .dropdown {
	padding-top: 60px;
	position: absolute;;
	width: 100%;
	display: none;
	background-color: white;
	color: black;
	font-size: 16px;
	border: 2px solid lightgrey;
.mega-menu-content > ul > li:first-child,.dropdown > ul >li:first-child {
	padding-top: 10px;
.mega-menu-content > ul> li, .dropdown > ul > li {
	display: block;
	min-width: 120px;
	min-height: 40px;
	margin: 0;
	padding: 0;
.mega-menu-content > ul > li > a, .dropdown > ul > li > a {
	color: red;
	font-size: 16px;
	min-width: 120px;
	padding: 8px 10px;
	border: 1px solid lightgrey;
.mega-menu-content {
	column-count: 3;
	column-width: 33%;
	column-gap: 0;
.mega-menu-content > ul > li > a:hover, .dropdown > ul > li > a:hover {
	background-color: lightgrey;
.nav > li:hover .mega-menu-content, .nav > li:hover .dropdown{
	display: block;
		<div class= "menu-container">
		<div class= "mega-menu">
			<ul class= "nav">
				<li><a href= "#">Home</a></li>
				<li><a href= "#">Clothing <i class="fa fa-chevron-circle-down" aria-hidden="true"></i></a>
					<div class= "mega-menu-content">
							<li><a href= "#">T-shirts</a></li>
							<li><a href= "#">Shirts</a></li>
							<li><a href= "#">Pants</a></li>
							<li><a href= "#">Shoes</a></li>
							<li><a href= "#">Sunglasses</a></li>
							<li><a href= "#">Caps</a></li>
							<li><a href= "#">Jewelry</a></li>
							<li><a href= "#">Others</a></li>
							<li><a href= "#">Jewelry</a></li>
							<li><a href= "#">Coats & Jackets</a></li>
							<li><a href= "#">Tops & Blouses</a></li>
							<li><a href= "#">Intimate & Sleep</a></li>
							<li><a href= "#">Jeans</a></li>
							<li><a href= "#">Pants</a></li>
							<li><a href= "#">Skirts</a></li>
							<li><a href= "#">Sweaters</a></li>
							<li><a href= "#">Boys</a></li>
							<li><a href= "#">Girls</a></li>
							<li><a href= "#">Baby</a></li>
							<li><a href= "#">Luggage</a></li>
						<ul>From Popular Sites<hr/>
							<li><a href= "#">Amazon</a></li>
							<li><a href= "#">Ebay</a></li>
							<li><a href= "#">Etsy</a></li>
							<li><a href= "#">Shoppify</a></li>
						<img src= "#" height= "100px" width= "100px" style= "float: right;"/>
				<li><a href= "#">Products <i class="fa fa-chevron-circle-down" aria-hidden="true"></i></a>
					<div class= "mega-menu-content">
						<img src= "#" height= "100%" width= "25%" style= "float: left;"/>
						<ul>Electronics & Computers<hr/>
							<li><a href= "#">TV & Video</a></li>
							<li><a href= "#">Cellphone & Camera</a></li>
							<li><a href= "#">Head Phones</a></li>
							<li><a href= "#">Video Games</a></li>
							<li><a href= "#">Computers & Tablets</a></li>
							<li><a href= "#">Monitors</a></li>
							<li><a href= "#">Schools & Office Supplies</a></li>
							<li><a href= "#">Trade In Your Electronics</a></li>
						    <ul>Health & Beauty<hr/>
							<li><a href= "#">All Beauty</a></li>
							<li><a href= "#">Luxury Beauty</a></li>
							<li><a href= "#">Specialty Diets</a></li>
							<li><a href= "#">Health,Household & Baby care</a></li>
							<li><a href= "#">Coupons</a></li>
						<ul>Sports & Outdoors<hr/>
							<li><a href= "#">Athletic Clothing</a></li>
							<li><a href= "#">Exercise & Fitness</a></li>
							<li><a href= "#">Hunting & Fishing</a></li>
							<li><a href= "#">Team Sports</a></li>
							<li><a href= "#">Cycling</a></li>
							<li><a href= "#">Water Sports</a></li>
							<li><a href= "#">Winter Sports</a></li>
							<li><a href= "#">All Sports</a></li>
				<li><a href= "#">Gifts <i class="fa fa-chevron-circle-down" aria-hidden="true"></i></a>
					<div class="dropdown">
							<li><a href= "#">Games</a></li>
							<li><a href= "#">Books</a></li>
							<li><a href= "#">Show Piece</a></li>
							<li><a href= "#">Kids Birthday</a></li>
				<li><a href= "#">Arts & Crafts</a></li>
				<li><a href= "#">Services</a></li>

Share this post

Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


  • Create New...