(Service Portal Design ServiceNow)
Left Nav Bar Widget Code:
HTML
<!DOCTYPE html> <html> <head> <script src="https://code.jquery.com/jquery-1.12.0.min.js"></script> <!-- Bootstrap Js CDN --> <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script> <!-- jQuery Custom Scroller CDN --> <script src="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.concat.min.js"></script> <!-- Bootstrap CSS CDN --> <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css"> <!-- Our Custom CSS --> <link rel="stylesheet" href="style2.css"> <!-- Scrollbar Custom CSS --> <link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/malihu-custom-scrollbar-plugin/3.1.5/jquery.mCustomScrollbar.min.css"> </head> <body> <div class="wrapper"> <!-- Sidebar Holder --> <nav id="sidebar"> <div class="sidebar-header"> <h3 style="color: black;font-size: 22px;font-weight: 700;">WorkingCode.in</h3> </div> <ul class="list-unstyled components"> <li> <input type="text" placeholder="Filter" class="form-control" style="width: 190px;margin-left: 15px;"> </li> </ul> <ul class="list-unstyled components"> <li class="active"> <a href="#homeSubmenu" data-toggle="collapse" aria-expanded="false" style="color: black;">Knowledge Base</a> <ul class="collapse list-unstyled" id="homeSubmenu"> <li><a href="javascript:void(0)" style="color: black;">My Knowledge Articles</a></li> <li><a href="javascript:void(0)" style="color: black;">Create Knowledge</a></li> <li><a href="javascript:void(0)" style="color: black;">Published Articles</a></li> </ul> </li> </ul> <ul class="list-unstyled components"> <li class="active"> <a href="#homeSubmenu1" data-toggle="collapse" aria-expanded="false" style="color: black;">Benefits</a> <ul class="collapse list-unstyled" id="homeSubmenu1"> <li><a href="javascript:void(0)" style="color: black;">My Knowledge Articles</a></li> <li><a href="javascript:void(0)" style="color: black;">Create Knowledge</a></li> <li><a href="javascript:void(0)" style="color: black;">Published Articles</a></li> </ul> </li> </ul> <ul class="list-unstyled components"> <li class="active"> <a href="#homeSubmenu2" data-toggle="collapse" aria-expanded="false" style="color: black;">Payroll</a> <ul class="collapse list-unstyled" id="homeSubmenu2"> <li><a href="javascript:void(0)" style="color: black;">My Knowledge Articles</a></li> <li><a href="javascript:void(0)" style="color: black;">Create Knowledge</a></li> <li><a href="javascript:void(0)" style="color: black;">Published Articles</a></li> </ul> </li> </ul> <ul class="list-unstyled components"> <li class="active"> <a href="#homeSubmenu3" data-toggle="collapse" aria-expanded="false" style="color: black;">Software</a> <ul class="collapse list-unstyled" id="homeSubmenu3"> <li><a href="javascript:void(0)" style="color: black;">My Knowledge Articles</a></li> <li><a href="javascript:void(0)" style="color: black;">Create Knowledge</a></li> <li><a href="javascript:void(0)" style="color: black;">Published Articles</a></li> </ul> </li> </ul> </nav> <!-- Page Content Holder --> </div> <!-- jQuery CDN --> <script type="text/javascript"> $(document).ready(function () { $("#sidebar").mCustomScrollbar({ theme: "minimal" }); $('#sidebarCollapse').on('click', function () { $('#sidebar, #content').toggleClass('active'); $('.collapse.in').toggleClass('in'); $('a[aria-expanded=true]').attr('aria-expanded', 'false'); }); }); </script> </body> </html>
CSS:
/* DEMO STYLE */ @import "https://fonts.googleapis.com/css?family=Poppins:300,400,500,600,700"; body { font-family: 'Poppins', sans-serif; background: #fafafa; } a{ color: #333579; } p { font-family: 'Poppins', sans-serif; font-size: 1.1em; font-weight: 300; line-height: 1.7em; color: #333579; } a, a:hover, a:focus { color: inherit; text-decoration: none; transition: all 0.3s; } .navbar { padding: 15px 10px; background: #fff; border: none; border-radius: 0; margin-bottom: 40px; box-shadow: 1px 1px 3px rgba(0, 0, 0, 0.1); } .navbar-btn { box-shadow: none; outline: none !important; border: none; } .line { width: 100%; height: 1px; border-bottom: 1px dashed #ddd; margin: 40px 0; } /* --------------------------------------------------- SIDEBAR STYLE ----------------------------------------------------- */ #sidebar { width: 250px; position: fixed; top: 114px; left: 0; height: 100vh; z-index: 999; background: #fff; color: #fff; transition: all 0.3s; } #sidebar.active { margin-left: -250px; } #sidebar .sidebar-header { padding: 20px; background: #ffffff; } #sidebar ul.components { padding: 20px 0; border-bottom: 1px solid #333579; } #sidebar ul p { color: #fff; padding: 10px; } #sidebar ul li a { padding: 10px; font-size: 1.1em; display: block; } #sidebar ul li a:hover { color: #fff; background: #fff; } #sidebar ul li.active > a, a[aria-expanded="true"] { color: #fff; background: #ffffff; } a[data-toggle="collapse"] { position: relative; } a[aria-expanded="false"]::before, a[aria-expanded="true"]::before { content: '\e259'; display: block; position: absolute; right: 20px; font-family: 'Glyphicons Halflings'; font-size: 0.6em; } a[aria-expanded="true"]::before { content: '\e260'; } ul ul a { font-size: 0.9em !important; padding-left: 30px !important; background: #fff; } ul.CTAs { padding: 20px; } ul.CTAs a { text-align: center; font-size: 0.9em !important; display: block; border-radius: 5px; margin-bottom: 5px; } a.download { background: #fff; color: #fff; } a.article, a.article:hover { background: #fff !important; color: #fff !important; } /* --------------------------------------------------- CONTENT STYLE ----------------------------------------------------- */ #content { width: calc(100% - 250px); padding: 40px; min-height: 100vh; transition: all 0.3s; position: absolute; top: 0; right: 0; } #content.active { width: 100%; } /* --------------------------------------------------- MEDIAQUERIES ----------------------------------------------------- */ @media (max-width: 768px) { #sidebar { margin-left: -250px; } #sidebar.active { margin-left: 0; } #content { width: 100%; } #content.active { width: calc(100% - 250px); } #sidebarCollapse span { display: none; } }
Image Widget:
HTML
<br> <div class="box" style="height: 553px;width: 94%;background-image: url(left.png);"> <br> <br> <br> <br> <br> <br><br> <br><br> <br> <h2 style="margin-left: 184px;">Welcome to Workingcode.in</h2> <input type="text" placeholder="Search.." class="form-control" style="width: 354px;margin-left: 184px;"> </div> <br>
CSS:
div{ height: 150px; width: 252px; background: #fff; border-radius: 20px; } .box{ box-shadow: 0px 5px 10px 0px rgba(0, 0, 0, 0.5); background-color: #f3ca20; }
Responsive Service Portal Design with left Navigation bar in ServiceNow with widget code
Working Code Edited question August 2, 2023