.new-application-menu {
background-color: #47484c;
height: 100%;
padding: 0px;
z-index: 10;
box-shadow: -1px 0px 2px #000000;
}
.new-application-menu ul {
color: #fff;
/* border: 1px solid white; */
}
.new-application-menu ul li {
padding: 8px;
border-bottom: 0.01px solid rgba(255, 255, 255, 0.2);
background-color: #27A9E3;
}
.new-application-menu ul li p {
font-size: 12px;
padding: 5px;
}
.new-application-menu ul li i {
font-size: 12px;
color: rgba(255, 255, 255, 0.8);
}
<div class="col-md-1 new-application-menu">
<ul class="nav navbar-nav text-center">
<li><img src="assets/Img/logo2.png" width="55" height="95"></li>
<li> <i class="material-icons" style="font-size:36px">description</i>
<p>بانک جامع اطلاعاتی</p>
</li>
<li> <i class="material-icons" style="font-size:36px">assessment</i>
<p>نبض شهر</p>
</li>
<li> <i class="material-icons" style="font-size:36px">colorize</i>
<p>آزمایشگاه شهری</p>
</li>
<li> <i class="material-icons" style="font-size:36px">remove_red_eye</i>
<p>رصد طرح های توسعه ی شهری</p>
</li>
<li> <i class="material-icons" style="font-size:36px">location_city</i>
<p>رصد پروژه های شهری</p>
</li>
</ul>
</div>
When I'm using this code and my list feature's height exceeds my page size, it automatically adds a scrollbar to my page and it causes to my grid system to overlay each other. How can I prevent this overlay?
You can use your custom class like .myLogo as i added
.new-application-menu {
background-color: #47484c;
height: 100%;
padding: 0px;
z-index: 10;
box-shadow: -1px 0px 2px #000000;
}
.new-application-menu ul
{
color: #fff;
/* border: 1px solid white; */
}
.new-application-menu ul li
{
padding: 8px;
border-bottom: 0.01px solid rgba(255,255,255,0.2);
background-color: #27A9E3;
}
.new-application-menu ul li p
{
font-size: 12px;
padding: 5px;
}
.new-application-menu ul li i
{
font-size: 12px;
color: rgba(255,255,255,0.8);
}
.myLogo{ width:100px; height:100px;}
<div class="col-md-1 new-application-menu">
<ul class="nav navbar-nav text-center">
<li><img src="assets/Img/logo2.png" width="55" height="95" class="myLogo"></li>
<li> <i class="material-icons" style="font-size:36px">description</i><p>بانک جامع اطلاعاتی</p></li>
<li> <i class="material-icons" style="font-size:36px">assessment</i> <p>نبض شهر</p></li>
<li> <i class="material-icons" style="font-size:36px">colorize</i><p>آزمایشگاه شهری</p> </li>
<li> <i class="material-icons" style="font-size:36px">remove_red_eye</i><p>رصد طرح های توسعه ی شهری</p> </li>
<li> <i class="material-icons" style="font-size:36px">location_city</i><p>رصد پروژه های شهری</p> </li>
</ul>
</div>
Related
I'm trying to give hover effect to .login-2-submenu a background effect on all li tags but not effecting at all , tried all possible methods. i tried to give ul to class but not worked i also tried to classs in li not worked as well ,
Am I missing something?
here is my html code
<nav>
<ul class="flex">
<li class="px-2"> <input class="searchbox px-2" type="search" name="search"
placeholder="Search for products, brands and more" autocomplete="off"><i class="fa-solid fa-magnifying-glass"></i>
</li>
<li class="btn-li px-2"> <button>Login</button>
<div class="login-submenu">
<div class="login1-1-submenu">
<h4>New Customer?</h4>
<a class="black" href="#">Sign Up</a>
</div>
<div class="login-2-submenu">
<ul>
<l1 class="block px border"><a class="black" href=""><i class="fa-solid fa-user"></i>My
Profile</a></l1>
<l1 class="block px border"><a class="black" href=""><i
class="fa-solid fa-circle-plus"></i>Flipkart Plus Zone</a></l1>
<l1 class="block px border"><a class="black" href=""><i
class="fa-solid fa-bag-shopping"></i>Orders</a></l1>
<l1 class="block px border"><a class="black" href=""><i
class="fa-solid fa-heart"></i>Wishlist</a></l1>
<l1 class="block px border"><a class="black" href=""><i
class="fa-solid fa-circle-dollar-to-slot"></i>Rewards</a></l1>
<l1 class="block px border"><a class="black" href=""><i
class="fa-solid fa-gift"></i>Gift Cards</a></l1>
</ul>
</div>
</div>
</li>
<li class="px-4"> Become a Seller</li>
<li class="px-4 toggle"> More
<div class="sub-menu">
<ul>
<li><i class="fa-solid fa-bell"></i>Notification Preferances</li>
<li><i class="fa-solid fa-question"></i>24/7 Customer Care
</li>
<li><i class="fa-solid fa-arrow-trend-up"></i>Advertise</li>
<li><i class="fa-solid fa-download"></i>Download App</li>
</ul>
</div>
</li>
<li class="px-5"> <i class="fa-solid fa-cart-shopping"></i>Cart</li>
</ul>
</nav>
and css
.sub-menu {
display: block;
position: absolute;
right: 170px;
top: 50px;
background-color: white;
width: 250px;
box-shadow: 0 3px 10px rgb(0 0 0 / 0.2);
}
.sub-menu ul {
text-align: left;
margin: 0;
padding: 0;
}
.sub-menu ul li {
padding: 15.3px 10px;
border-bottom: 1px solid #d0d9d4;
}
.sub-menu .fa-solid {
padding: 0 10px;
color: #2874f0;
}
.sub-menu ul li:hover {
background-color: #ebf2f0;
}
.sub-menu ul li a {
color: black;
}
/* -----------------------------------------------------------------------login-submenu---------------------------------------------- */
.login-submenu {
background-color: white;
position: absolute;
top: 50px;
right: 465px;
box-shadow: 0 3px 10px rgb(0 0 0 / 0.2);
height: 345px;
width: 250px;
}
.login-submenu ul {
padding: 0;
margin: 0;
}
.login-submenu .fa-solid {
padding: 0 10px;
color: #2874f0;
}
.sign {
color: blue !important;
font-size: 15px;
font-weight: 600;
transform: translate(160px, 0);
}
.login-submenu ul li:hover {
background-color: #28cf8c !important;
}
.login1-1-submenu {
display: flex;
border-bottom: 1px solid #d0d9d4;
padding: 15px 10px;
}
.login1-1-submenu h4 {
color: rgba(20, 20, 20, 0.9);
}
.login1-1-submenu a {
padding-left: 50px;
color: blue;
font-weight: 600;
}
.login1-1-submenu:hover {
background-color: #ebf2f0;
}
.login-2-submenu ul li:hover {
background-color: #ebf2f0 !important;
}
I'm tried to give hover effect to login-2-submenu but not working but other hover effect are working.
<l1 class="block px border"> just look this code, you have typed l1 instead of li
all li tags are misspelled in under .login-2-submenu
first time posting a question here, hope someone can help!
I want to create a list of social media icon/links
<div class="social-links">
<ul>
<li class="m-link">
<i class="far fa-envelope"></i>
</li>
<li class="m-link">
<i class="fab fa-linkedin-in"></i>
</li>
<li class="m-link">
<i class="far fa-address-card"></i>
</li>
</ul>
</div>
.m-link {
width: 2em;
height: 2em;
text-align: center;
list-style: none;
margin: 10px 30px;
display: inline-block;
font-size: 2.5em;
line-height: 2em;
color: #e2e2e2;
border: 1px solid #e2e2e2;
border-radius: 50%;
cursor: pointer;
transition: 0.5s;
}
.m-link:hover {
background-color: #e2e2e2;
color: #0b0a08;
box-shadow: 0 0 15px #9ecaed;
}
.m-link a {
text-decoration: none;
color: #e2e2e2;
}
My problem is that in this way the hover color doesn't apply on the icon/link, I tried to add an extra hover just for the ".m-link a" like so..
.m-link a:hover {
color: #0b0a08;
}
but in this way the color apply only when my cursor is on the link and not when I hover on the list element.
Still a beginner here, someone help pleaseeee!!
You need to target the element inside the element on hover, like this
.m-link:hover a > i { /* 'on hover on .m-link class element, then i inside a will take this css code */
background-color: #e2e2e2;
color: #0b0a08;
box-shadow: 0 0 15px #9ecaed;
}
.m-link {
width: 2em;
height: 2em;
text-align: center;
list-style: none;
margin: 10px 30px;
display: inline-block;
font-size: 2.5em;
line-height: 2em;
color: #e2e2e2;
border: 1px solid #e2e2e2;
border-radius: 50%;
cursor: pointer;
transition: 0.5s;
}
.m-link:hover a > i {
background-color: #e2e2e2;
color: #0b0a08;
box-shadow: 0 0 15px #9ecaed;
}
.m-link a {
text-decoration: none;
color: #e2e2e2;
}
<script src="https://kit.fontawesome.com/9114d9acc8.js" crossorigin="anonymous"></script>
<div class="social-links">
<ul>
<li class="m-link">
<i class="far fa-envelope"></i>
</li>
<li class="m-link">
<i class="fab fa-linkedin-in"></i>
</li>
<li class="m-link">
<i class="far fa-address-card"></i>
</li>
</ul>
</div>
I am trying to make the color of the side bar. when I try to make the browser window small the color at the bottom left is like a faded black and white and I am trying to make the scrollbar hidden but still can scroll and also looking a CSS code that can make the word steady when I close and open my side navigation menu.
Thank you for helping me in advance.
enter image description here
my css code
.contentnav{
height: 100%;
color: rgba(255,255,255,1);
background: rgba(0, 0, 0, 0.6);
top: 0;
left: 0;
padding-top: 50px;
transition: left 0.3s linear;
width: 50px;
display: block;
}
.contentnav::-webkit-scrollbar-thumb{
background: #115a01;
outline: 1px solid rgba(255,255,255,1);
}
.contentnav::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
}
.contentnav::-webkit-scrollbar {
width: 0.4em;
}
.contentnav ul li ul{
display: none;
}
.contentnav ul i{
margin-left: 10px;
color: #FFFFFF;
text-shadow: 1px 1px 1px #000;
padding: 5px;
width: 25px;
padding-bottom: 8px;
cursor: pointer;
vertical-align:middle;
}
.contentnav ul{
list-style: none;
margin:0px;
padding:0px;
}
.contentnav ul span{
position: absolute;
margin-left: 21px;
cursor: pointer;
margin-top: 5px;
float: left;
}
.contentnav i:hover{
color: rgba(0,204,102,1);
}
my html code
<div class="contentnav" id="contentmenu">
<ul>
<li>
<i class="fas fa-home"></i>
<span id="same" class="nav-text">Home</span>
</li>
<li>
<i class="fas fa-book"></i>
<span id="same" class="nav-text">L</span>
<ul>
<li>-Bo</li>
<li>-B</li>
<li>-R</li>
<li>-E</li>
<li>-P</li>
</ul>
</li>
<li>
<i class="fas fa-hourglass-half"></i>
<span id="same" class="nav-text">Online</span>
</li>
<li>
<i class="fas fa-bookmark"></i>
<span id="same" class="nav-text">E</span>
<ul>
<li>-S</li>
<li>-Fee</li>
</ul>
</li>
<li>
<i class="fas fa-file-alt"></i>
<span id="same" class="nav-text">C</span>
</li>
<li>
<i class="fas fa-clipboard"></i>
<span id="same" class="nav-text">G</span>
</li>
<li>
<i class="fas fa-info-circle"></i>
<span id="same" class="nav-text">Announcement</span>
</li>
<li>
<i class="far fa-calendar-alt"></i>
<span id="same" class="nav-text">Calendar</span>
</li>
<li>
<i class="fab fa-hire-a-helper"></i>
<span id="same" class="nav-text">Guides</span>
</li>
<li>
<i class="fas fa-sign-out-alt"></i>
<span id="same" class="nav-text">Logout</span>
</li>
</ul>
</div>
I think this should do the trick.
Remove this and
.contentnav::-webkit-scrollbar-thumb{
background: #115a01;
outline: 1px solid rgba(255,255,255,1);
}
.contentnav::-webkit-scrollbar-track {
-webkit-box-shadow: inset 0 0 6px rgba(0,0,0,0.3);
}
.contentnav::-webkit-scrollbar {
width: 0.4em;
}
Replace it with this.
.contentnav::-webkit-scrollbar-button
{
display: block;
height: 13px;
border-radius: 0px;
background-color: #AAA;
}
.contentnav::-webkit-scrollbar-button:hover
{
background-color: #AAA;
}
.contentnav::-webkit-scrollbar-thumb
{
background-color: #CCC;
}
.contentnav::-webkit-scrollbar-thumb:hover
{
background-color: #CCC;
}
.contentnav::-webkit-scrollbar-track
{
background-color: #efefef;
}
.contentnav::-webkit-scrollbar-track:hover
{
background-color: #CCC;
}
.contentnav::-webkit-scrollbar
{
width: 15px;
}
This is my current menu:
And here what I want:
First submenu is inline, and the child is dropdown.
I'm trying to change the ul li a display to inline-block but seems like it not working at all. How I suppose to do to make the submenu hover inline, and the child of the submenu dropdown?
Thank you so much.
#info {
top: 8%;
color: #fff;
height: auto;
font-family: arial;
left: 0px;
position: absolute;
width: 72px;
z-index: 40;
border-radius: 4px;
background: dimgrey;
}
nav ul ul {
display: none;
}
nav ul li:hover > ul {
display: block;
}
nav ul {
background: #efefef;
padding: 0;
list-style: none;
position: relative;
display: inline-table;
}
nav ul:after {
content: "";
clear: both;
display: inline;
}
nav ul li {
position:relative;
width:70px;
}
nav ul li:hover {
background: #4b4b4b;
}
nav ul li:hover a {
color: #fff;
}
nav ul li:hover button{
color: #fff;
}
nav ul li a {
display: block;
padding: 12px 20px;
color: #757575;
text-decoration: none;
}
nav ul li button{
display: block;
padding: 12px 25px;
color: #757575;
text-decoration: none;
}
nav ul ul {
background: #5f6975;
border-radius: 0px;
padding: 0;
position: absolute;
top:0;
left:100%;
}
nav ul ul li {
float: none;
position: relative;
}
nav ul ul li a {
padding: 12px 25px;
color: #fff;
}
nav ul ul li button{
padding: 12px 25px;
color: #fff;
height: 50px; width: 100px; margin-bottom: 2px; font-size: 18px;
}
nav ul ul li a:hover {
background: #4b4b4b;
}
nav ul ul ul {
position: absolute;
left: 100%;
top:0;
}
.menu-container {padding: 19px 0; width: 70px; float: left;}
.clear {clear: both;}
ul{list-style:none;
border:0;outline:none;margin:0;padding:0;}
/* Vertical Mega Menu Styles */
.mega-menu{
font: bold 13px Arial, sans-serif;
line-height: 16px;
background: #333;
border-left: 1px solid #1B1B1B;
position: relative; /* Required */
}
.mega-menu li a {
display: block;
color: #fff;
padding: 12px 20px 12px 20px;
text-shadow: 1px 1px 1px #000;
text-decoration: none;
border-top: 1px solid #555;
border-bottom: 1px solid #222;
border-right: 1px solid #1B1B1B;
}
.mega-menu li button {
display: block;
color: #fff;
text-shadow: 1px 1px 1px #000;
text-decoration: none;
border-top: 1px solid #555;
border-bottom: 1px solid #222;
border-right: 1px solid #1B1B1B;
}
.mega-menu li a:hover, .mega-menu li.mega-hover a {
background: #4b4b4b;
color: #fff;
border-right: 1px solid #4b4b4b;
}
<div id="info">
<!--
<li><button id="FreehandPolyline">Freehand Polyline</button></li>
<li><button id="Triangle">Triangle</button></li>
<li><button id="Extent">Rectangle</button></li>
<li><button id="Circle">Circle</button></li>
<li><button id="Ellipse">Ellipse</button></li>
<li><button id="Polygon">Polygon</button></li>
<li><button id="FreehandPolygon">Freehand Polygon</button></li> -->
<!-- <div id="menu_plotting" >Menu plotting</div> -->
<nav class="menu-container clear">
<ul id="mega-1" class="mega-menu">
<li>
<a title="Plotting Toolbar"><img src="assets/icon/pencil.png" width="30" height="30"></a>
<ul>
<li><a title="Arrows"><img src="assets/icon/arrow.png" width="30" height="30"></a>
<ul>
<li>
<a title="Straight Arrow" onClick="urlicon('arrow','')" style="cursor: pointer;">
<img src="assets/icon/arrow0.png" width="30" height="30"></a>
<!-- <a id="a" class="btn btn-info" onclick="arrow_('arrow')" style="cursor: pointer;">
<img src="icon/arrow.png" width="30" height="30"></a> -->
</li>
<li>
<a title="Down Arrow" onClick="urlicon('arrow_l','')" style="cursor: pointer;">
<img src="assets/icon/bawah.png" width="30" height="30"></a>
</li>
<li>
<a title="Up Arrow" onClick="urlicon('arrow_a','')" style="cursor: pointer;"> <img src="assets/icon/atas.png" width="30" height="30"></a>
</li>
</ul>
</li>
<li><a title="Polyline"><img src="assets/icon/polyline-48.png" width="30" height="30"></a>
<ul>
<li><a title="Polyline" id="Polyline" onClick="urlicon('polyline','')"><img src="assets/icon/polyline.png" width="30" height="30">
</a>
</li>
<li><a title="Freehand Polyline" id="FreehandPolyline"><img src="assets/icon/freepolyline.png" width="30" height="30"></a></li>
</ul>
</li>
<li><a title="Polygon"><img src="assets/icon/polygon.png" width="30" height="30"></a>
<ul>
<li><a title="Polygon" id="Polygon" onClick="urlicon('polygon','')">
<img src="assets/icon/polygon.png" width="30" height="30">
</a>
</li>
<li><a title="Triangle" id="Triangle"><img src="assets/icon/triangle.png" width="30" height="30"></a></li>
<li><a title="Rectangle" id="Extent"><img src="assets/icon/rectangle.png" width="30" height="30"></a></li>
<li><a title="Circle" id="Circle"><img src="assets/icon/circle.png" width="30" height="30"></a></li>
<li><a title="Ellipse" id="Ellipse"><img src="assets/icon/ellips.png" width="30" height="30"></a></li>
<li><a title="Freehand Polygon" id="FreehandPolygon"><img src="assets/icon/freepolygon.png" width="30" height="30"></a></li>
</ul>
</li>
<li>
<a title="Text" onClick="select_text()"> <img src="assets/icon/font.png" alt="Text" width="30" height="30"> </a>
</li>
</ul>
</li>
<li><a title="Radar"><img src="assets/icon/radar.png" width="30" height="30"></a></li>
<li><a title="Manuver"><img src="assets/icon/airplane.png" width="30" height="30"></a></li>
<!-- ASOPS -->
<?php } if ($list['asisten']==1 || $list['asisten']==6) {?>
<li>
<a title="Obstacle" onClick="select_obst()"><img src="assets/icon/obstacle.png" width="30" height="30"></a>
</li>
<li>
<a title="Strength" onClick="select_kekuatan()"><img src="assets/icon/streng.png" width="30" height="30"></a>
</li>
<li>
<a title="Unit" onClick="select_unit()"><img src="assets/icon/icons8-Org Unit-48.png" width="30" height="30"></a>
</li>
<li>
<a title="Situation" onClick="select_situasi()"><img src="assets/icon/warning.png" width="30" height="30"></a>
</li>
<?php if($list['asisten']==6 && $_SESSION['menu_'] == "menu"){ ?>
<script type="text/javascript">
document.getElementById("info3").style.display = "block";
</script>
<?php
}
}
} ?>
</ul>
</nav>
<div style="font-size: 13px; margin-left: -20px;" id="nm_scen"><?php echo $_SESSION['scen1']; ?></div>
</div>
You are almost there. You need to specify a fixed width to the inner UL because by default it will have 100% of the width of its relative positioned ancestor, and that width is not enough to have more than one item per line in the second menu level.
nav>ul>li>ul {
width: 291px
}
Hope this helps.
#info {
top: 8%;
color: #fff;
height: auto;
font-family: arial;
left: 0px;
position: absolute;
width: 72px;
z-index: 40;
border-radius: 4px;
background: dimgrey;
}
nav ul ul {
display: none;
}
nav ul li:hover>ul {
display: block;
}
nav ul {
background: #efefef;
padding: 0;
list-style: none;
position: relative;
display: inline-table;
}
nav ul:after {
content: "";
clear: both;
display: inline;
}
nav ul li {
position: relative;
width: 70px;
}
nav ul li:hover {
background: #4b4b4b;
}
nav ul li:hover a {
color: #fff;
}
nav ul li:hover button {
color: #fff;
}
nav ul li a {
display: block;
padding: 12px 20px;
color: #757575;
text-decoration: none;
}
nav ul li button {
display: block;
padding: 12px 25px;
color: #757575;
text-decoration: none;
}
nav ul ul {
background: #5f6975;
border-radius: 0px;
padding: 0;
position: absolute;
top: 0;
left: 100%;
}
nav ul ul li {
float: none;
position: relative;
display: inline-block;
}
nav ul ul li a {
padding: 12px 25px;
color: #fff;
}
nav ul ul li button {
padding: 12px 25px;
color: #fff;
height: 50px;
width: 100px;
margin-bottom: 2px;
font-size: 18px;
}
nav ul ul li a:hover {
background: #4b4b4b;
}
nav ul ul ul {
position: absolute;
left: 100%;
top: 0;
}
nav>ul>li>ul>li>ul {
top: 100%;
left: 0;
}
nav>ul>li>ul {
width: 291px
}
.menu-container {
padding: 19px 0;
width: 70px;
float: left;
}
.clear {
clear: both;
}
ul {
list-style: none;
border: 0;
outline: none;
margin: 0;
padding: 0;
}
/* Vertical Mega Menu Styles */
.mega-menu {
font: bold 13px Arial, sans-serif;
line-height: 16px;
background: #333;
border-left: 1px solid #1B1B1B;
position: relative;
/* Required */
}
.mega-menu li a {
display: block;
color: #fff;
padding: 12px 20px 12px 20px;
text-shadow: 1px 1px 1px #000;
text-decoration: none;
border-top: 1px solid #555;
border-bottom: 1px solid #222;
border-right: 1px solid #1B1B1B;
}
.mega-menu li button {
display: block;
color: #fff;
text-shadow: 1px 1px 1px #000;
text-decoration: none;
border-top: 1px solid #555;
border-bottom: 1px solid #222;
border-right: 1px solid #1B1B1B;
}
.mega-menu li a:hover,
.mega-menu li.mega-hover a {
background: #4b4b4b;
color: #fff;
border-right: 1px solid #4b4b4b;
}
<div id="info">
<!--
<li><button id="FreehandPolyline">Freehand Polyline</button></li>
<li><button id="Triangle">Triangle</button></li>
<li><button id="Extent">Rectangle</button></li>
<li><button id="Circle">Circle</button></li>
<li><button id="Ellipse">Ellipse</button></li>
<li><button id="Polygon">Polygon</button></li>
<li><button id="FreehandPolygon">Freehand Polygon</button></li> -->
<!-- <div id="menu_plotting" >Menu plotting</div> -->
<nav class="menu-container clear">
<ul id="mega-1" class="mega-menu">
<li>
<a title="Plotting Toolbar"><img src="assets/icon/pencil.png" width="30" height="30"></a>
<ul>
<li>
<a title="Arrows"><img src="assets/icon/arrow.png" width="30" height="30"></a>
<ul>
<li>
<a title="Straight Arrow" onClick="urlicon('arrow','')" style="cursor: pointer;">
<img src="assets/icon/arrow0.png" width="30" height="30"></a>
<!-- <a id="a" class="btn btn-info" onclick="arrow_('arrow')" style="cursor: pointer;">
<img src="icon/arrow.png" width="30" height="30"></a> -->
</li>
<li>
<a title="Down Arrow" onClick="urlicon('arrow_l','')" style="cursor: pointer;">
<img src="assets/icon/bawah.png" width="30" height="30"></a>
</li>
<li>
<a title="Up Arrow" onClick="urlicon('arrow_a','')" style="cursor: pointer;"> <img src="assets/icon/atas.png" width="30" height="30"></a>
</li>
</ul>
</li>
<li>
<a title="Polyline"><img src="assets/icon/polyline-48.png" width="30" height="30"></a>
<ul>
<li>
<a title="Polyline" id="Polyline" onClick="urlicon('polyline','')"><img src="assets/icon/polyline.png" width="30" height="30">
</a>
</li>
<li>
<a title="Freehand Polyline" id="FreehandPolyline"><img src="assets/icon/freepolyline.png" width="30" height="30"></a>
</li>
</ul>
</li>
<li>
<a title="Polygon"><img src="assets/icon/polygon.png" width="30" height="30"></a>
<ul>
<li>
<a title="Polygon" id="Polygon" onClick="urlicon('polygon','')">
<img src="assets/icon/polygon.png" width="30" height="30">
</a>
</li>
<li>
<a title="Triangle" id="Triangle"><img src="assets/icon/triangle.png" width="30" height="30"></a>
</li>
<li>
<a title="Rectangle" id="Extent"><img src="assets/icon/rectangle.png" width="30" height="30"></a>
</li>
<li>
<a title="Circle" id="Circle"><img src="assets/icon/circle.png" width="30" height="30"></a>
</li>
<li>
<a title="Ellipse" id="Ellipse"><img src="assets/icon/ellips.png" width="30" height="30"></a>
</li>
<li>
<a title="Freehand Polygon" id="FreehandPolygon"><img src="assets/icon/freepolygon.png" width="30" height="30"></a>
</li>
</ul>
</li>
<li>
<a title="Text" onClick="select_text()"> <img src="assets/icon/font.png" alt="Text" width="30" height="30"> </a>
</li>
</ul>
</li>
<li>
<a title="Radar"><img src="assets/icon/radar.png" width="30" height="30"></a>
</li>
<li>
<a title="Manuver"><img src="assets/icon/airplane.png" width="30" height="30"></a>
</li>
<!-- ASOPS -->
<?php } if ($list['asisten']==1 || $list['asisten']==6) {?>
<li>
<a title="Obstacle" onClick="select_obst()"><img src="assets/icon/obstacle.png" width="30" height="30"></a>
</li>
<li>
<a title="Strength" onClick="select_kekuatan()"><img src="assets/icon/streng.png" width="30" height="30"></a>
</li>
<li>
<a title="Unit" onClick="select_unit()"><img src="assets/icon/icons8-Org Unit-48.png" width="30" height="30"></a>
</li>
<li>
<a title="Situation" onClick="select_situasi()"><img src="assets/icon/warning.png" width="30" height="30"></a>
</li>
<?php if($list['asisten']==6 && $_SESSION['menu_'] == "menu"){ ?>
<script type="text/javascript">
document.getElementById("info3").style.display = "block";
</script>
<?php
}
}
} ?>
</ul>
</nav>
<div style="font-size: 13px; margin-left: -20px;" id="nm_scen">
<?php echo $_SESSION['scen1']; ?>
</div>
</div>
I'm training my bad css skills and I can't figure out how create a left navbar (see the image below).
Note: I already have a top navbar... And in the middle of both will exist the content of page.
<aside>
<div class="navbar navbar-fixed-left">
<ul class="nav navbar-nav">
<li style="border-right: 0px solid #bdc3c7; border-top: 0.5px solid #bdc3c7;">
<a href="#">
<i class="fa fa-plus" aria-hidden="true" style="color: grey;"></i> CREATE
</a>
</li>
<li style="border-top: 1px solid #bdc3c7;">
<a href="#">
<i class="fa fa-plus" aria-hidden="true" style="color: grey;"></i> CREATE
</a>
</li>
<li style="border-top: 1px solid #bdc3c7; border-bottom: 1px solid #bdc3c7;">
<a href="#">
<i class="fa fa-plus" aria-hidden="true" style="color: grey;"></i> CREATE
</a>
</li>
</ul>
</div>
</aside>
And my css:
.navbar-fixed-left {
width: 180px;
position: fixed;
border-radius: 0;
height: 100%;
background-color: #F0F0F0;
border-right: 1px solid #bdc3c7;
}
.navbar-fixed-left .navbar-nav > li {
float: none;
width: 178px;
}
.navbar-fixed-left + .container {
padding-left: 160px;
}
.navbar-fixed-left .navbar-nav > li > .dropdown-menu {
margin-top: -50px;
margin-left: 140px;
}
aside {
margin-top: 55px;
}
You can try CSS Flexbox. Make your ul li a element a flex container & wrap your text inside a wrapper (in my case .text). And apply the following properties:
ul li a {
display: flex;
text-decoration: none;
}
Have a look at the snippet below:
body {
margin: 0;
}
.navbar-fixed-left {
width: 180px;
position: fixed;
border-radius: 0;
height: 100%;
background-color: #F0F0F0;
border-right: 1px solid #bdc3c7;
}
.navbar-fixed-left + .container {
padding-left: 160px;
}
.navbar-fixed-left .navbar-nav > li > .dropdown-menu {
margin-top: -50px;
margin-left: 140px;
}
aside {
margin-top: 55px;
}
ul {
list-style: none;
padding: 0;
margin: 0;
}
ul li a {
display: flex;
text-decoration: none;
}
ul li a:hover {
background: #E0E1E6;
}
ul li a i {
padding: 10px;
border-right: 1px solid #bdc3c7;
}
ul li a .text {
padding: 10px;
}
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet"/>
<aside>
<div class="navbar navbar-fixed-left">
<ul class="nav navbar-nav">
<li style="border-right: 0px solid #bdc3c7; border-top: 0.5px solid #bdc3c7;">
<a href="#">
<i class="fa fa-plus" aria-hidden="true" style="color: grey;"></i><span class="text">CREATE</span>
</a>
</li>
<li style="border-top: 1px solid #bdc3c7;">
<a href="#">
<i class="fa fa-plus" aria-hidden="true" style="color: grey;"></i><span class="text">CREATE</span>
</a>
</li>
<li style="border-top: 1px solid #bdc3c7; border-bottom: 1px solid #bdc3c7;">
<a href="#">
<i class="fa fa-plus" aria-hidden="true" style="color: grey;"></i><span class="text">CREATE</span>
</a>
</li>
</ul>
</div>
</aside>
Hope this helps!
Try this following code,
<!DOCTYPE html>
<html lang="en">
<head>
<title>Menu</title>
<link rel="stylesheet" href="assets/css/bootstrap.min.css" />
<link rel="stylesheet" href="assets/font-awesome/4.5.0/css/font-awesome.min.css" />
<link rel="stylesheet" href="assets/css/ace.min.css" class="ace-main-stylesheet" id="main-ace-style" />
</head>
<body class="no-skin">
<div id="sidebar" class="sidebar responsive ace-save-state">
<ul class="nav nav-list">
<li class="">
<a href="#" class="dropdown-toggle">
<i class="menu-icon fa fa-list"></i>
<span class="menu-text"> Applications </span>
<b class="arrow fa fa-angle-down"></b>
</a>
<b class="arrow"></b>
</li>
<li class="">
<a href="#" class="dropdown-toggle">
<i class="menu-icon fa fa-list"></i>
<span class="menu-text"> Applications </span>
<b class="arrow fa fa-angle-down"></b>
</a>
<b class="arrow"></b>
</li>
</ul><!-- /.nav-list -->
</div>
</body>
</html>
To get the related CSS files, Click Here https://github.com/suthagar23/AdmissionSystem/tree/master/public
EDIT: I think the issue is snippet output's viewport is smaller and eats some styles, you will have to tweak values through #media querys if you wish to preserve responsiveness with the code you provided:
Full resizable JSFiddle here (a few CSS were changed vs the snippet below, to make it look ok on bigger viewport)
Big viewport:
Smaller viewport:
Isolate icons from text menu by wrapping text on <span>. Make lis relative and icons absolute and adjust values as desired:
.navbar-fixed-left {
width: 180px;
position: fixed;
border-radius: 0;
height: 100%;
background-color: #F0F0F0;
border-right: 1px solid #bdc3c7;
}
ul.nav.navbar-nav {
margin-top: 0;
}
.navbar-fixed-left .navbar-nav li {
float: none;
width: 194px;
border-top: 1px solid #bdc3c7;
position: relative;
border-right: 1px solid lightgray;
}
li:nth-child(3) {
border-bottom: 1px solid #bdc3c7;
}
.navbar-fixed-left .navbar-nav li a:hover {
background-color: gainsboro;
}
.navbar-fixed-left + .container {
padding-left: 160px;
}
.navbar-fixed-left .navbar-nav > li > .dropdown-menu {
margin-top: -50px;
margin-left: 140px;
}
span {
margin-left: 60px;
color: gray;
}
aside {
margin-top: 55px;
}
i.fa {
border-right: 1px solid #bdc3c7;
padding: 10px 15px;
position: absolute;
top: 0;
bottom: 0;
line-height: 20px;
}
.color1 {
border-left: 3px solid red;
margin-left: -1px;
}
.color2 {
border-left: 3px solid blue;
margin-left: -1px;
}
.color3 {
border-left: 3px solid green;
margin-left: -1px;
}
<script src="https://ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
<aside>
<div class="navbar navbar-fixed-left">
<ul class="nav navbar-nav">
<li>
<a href="#">
<i class="fa fa-plus color1" aria-hidden="true" style="color: grey;"></i><span>CREATE</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-plus color2" aria-hidden="true" style="color: grey;"></i><span>CREATE</span>
</a>
</li>
<li>
<a href="#">
<i class="fa fa-plus color3" aria-hidden="true" style="color: grey;"></i><span>CREATE</span>
</a>
</li>
</ul>
</div>
</aside>