<!DOCTYPE html>
<html>
<head>
<title>test</title>
<meta charset="utf-8">
<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/font-awesome.min.css">
<link href="[URL]https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css[/URL]" rel="stylesheet">
</head>
<body dir="rtl">
<nav>
<div class="menu-icon">
<i class="fa fa-bars fa-2x"></i>
</div>
<ul>
<li class="logo"><a href="#"><img src="img/logo.png" width="70px" heidth="50px"></a></li>
<li><a href="#">home</a></li>
<li><a href="#">work</a>
<ul>
<div class="menu">
<h3 class="category-1"><a href="#">category</a></h3>
<li><a href="#">link 1</a></li>
<li><a href="#">link 2</a></li>
<li><a href="#">link 3</a></li>
<li><a href="#">link 4</a></li>
</ul>
<ul class="menu-col-1">
<h3>category</h3>
<li><a href="#">link 1</a></li>
<li><a href="#">link 2</a></li>
<li><a href="#">link 3</a></li>
<li><a href="#">link 4</a></li>
</ul>
<ul class="menu-col-1">
<h3>category</h3>
<li><a href="#">link 1</a></li>
<li><a href="#">link 2</a></li>
<li><a href="#">link 3</a></li>
<li><a href="#">link 4</a></li>
</ul>
</li>
<li><a href="#">about</a></li>
<li><a href="#">contact</a></li>
</div>
</ul>
</nav>
<script type="text/javascript" src="js/jquery-3.2.1.min.js"></script>
<script type="text/javascript" src="js/script.js"></script>
</body>
</html>
body {
padding: 0;
margin: 0;
font-family: sans-serif;
}
nav li.logo:hover {
background-color: transparent;
}
ul {
margin: 0;
padding: 0;
background-color: #00695c;
list-style-type: none;
position: relative;
text-align: center;
}
ul li {
display: inline-block;
}
ul li a {
color: #fff;
text-decoration: none;
padding: 15px;
margin: 0px;
display: block;
}
ul li:hover {
background-color: #00897b;
}
ul li:hover ul {
display: block;
}
ul ul {
display: none;
position: absolute;
padding: 25px;
text-align: right;
background-color: #00897b;
right: 720px;
}
.menu-col-1,
.menu-col-2,
.menu-col-3,
.menu-col-4 {
float: right;
ul li.menu-col-1 {
display: inline-block;
}
.menu {
float: right;
}
}
.menu-col-1 {
width: 25%;
}
ul ul li {
display: block;
background-color: #00897b;
}
ul ul li:hover {
background-color: #26a69a;
}
nav div {
display: none;
background-color: #000;
color: #fff;
text-align: left;
padding: 10px;
cursor: pointer;
}
@media (max-width: 480px) {
nav div {
display: block;
}
ul {
display: none;
position: static;
padding-top: 5px;
}
h3 {
margin: 0;
text-align: center;
padding: 13px;
}
h3.category-1 {
border-bottom: 1px solid #014f45;
padding: 1px;
}
h3:hover.category-1 a {
background-color: #26a69a;
}
ul li {
display: block;
border-bottom: 1px solid #014f45;
text-align: center;
}
ul ul.menu-col-1 {
position: static;
background-color: #4db6ac;
width: 100%;
padding: 0;
}
ul ul li {
background-color: #4db6ac;
border-radius: 0;
width: 100%;
}
}
$(window).resize(function() {
if ($(window).width() > 480) {
$("ul").removeAttr('style');
};
});
$ ("nav div").click(function() {
$("ul").slideToggle();
$("ul ul").css("display", "none");
});
$("ul li").click(function() {
$(".menu").slideUp();
$(this).find('ul').slideToggle();
});
<!doctype html>
<html>
<head>
<meta charset='utf-8'>
<title>example</title>
<style type='text/css'>
div.divContent { display:inline-block; width:24.5%; min-width:200px; background-color:#a0a0a0 }
div.divContent > h2 { color:white; }
div.divContent > ul > li { color:blue; }
</style>
</head>
<div class='divContent'>
<h2> content 1 </h2>
<ul>
<li> link 1 </li>
<li> link 2 </li>
<li> link 3 </li>
<li> link 4 </li>
</ul>
</div>
<div class='divContent'>
<h2> content 2 </h2>
<ul>
<li> link 1 </li>
<li> link 2 </li>
<li> link 3 </li>
<li> link 4 </li>
</ul>
</div>
<div class='divContent'>
<h2> content 3 </h2>
<ul>
<li> link 1 </li>
<li> link 2 </li>
<li> link 3 </li>
<li> link 4 </li>
</ul>
</div>
<div class='divContent'>
<h2> content 4 </h2>
<ul>
<li> link 1 </li>
<li> link 2 </li>
<li> link 3 </li>
<li> link 4 </li>
</ul>
</div>
<div class='divContent'>
<h2> content 5 </h2>
<ul>
<li> link 1 </li>
<li> link 2 </li>
<li> link 3 </li>
<li> link 4 </li>
</ul>
</div>
<div class='divContent'>
<h2> content 6 </h2>
<ul>
<li> link 1 </li>
<li> link 2 </li>
<li> link 3 </li>
<li> link 4 </li>
</ul>
</div>
<div class='divContent'>
<h2> content 7 </h2>
<ul>
<li> link 1 </li>
<li> link 2 </li>
<li> link 3 </li>
<li> link 4 </li>
</ul>
</div>
<div class='divContent'>
<h2> content 8 </h2>
<ul>
<li> link 1 </li>
<li> link 2 </li>
<li> link 3 </li>
<li> link 4 </li>
</ul>
</div>
</html>
Copyright©1996-2021,Tapuz Media Ltd. Forum software by XenForo® © 2010-2020 XenForo Ltd.