Split up li in navbar to different sides using flexbox

Split up li in navbar to different sides using flexbox

Content Index :

Split up li in navbar to different sides using flexbox
Tag : html , By : Shawazi
Date : November 27 2020, 12:01 PM

like below fixes the issue Here is updated version
nav {
    background-color: #265B8B;
    color: white;
    position: fixed;
    width: 100%;
    display: flex;

nav p {
    font-weight: bold;
    margin-left: 1em;
    color: white;
    text-align: left;
    font-size: 1em;

nav a {
    color: white;
    font-size: 1em;
    font-weight: bold;

nav ul {
    flex: 1;
    margin-bottom: 5em;
    display: flex;
    flex-direction: row-reverse;
    margin-top: 1.25em;

nav li {
    list-style: none;
    margin-right: 1em;

nav li.linkedin {
  margin-right: auto;

nav img {
    width: 25px;
    height: 25px;
    margin-right: 10px;

.menu-toggle {
    position: absolute;
    padding: 0.8 em;
    top: 1em;
    right: 1em;
    cursor: pointer;
        <p>STEVEN KANG</p>
            <li class="rightLinks contact"><a data-scroll-target="contact">Contact</a></li>
            <li class="rightLinks"><a data-scroll-target="projects">Portfolio</a></li>
            <li class="rightLinks"><a data-scroll-target="bio">Bio</a></li>
            <li class="leftLinks linkedin"><a href="https://www.linkedin.com/in/stevenkangj" target="_blank"><img src="https://upload.wikimedia.org/wikipedia/commons/c/ca/LinkedIn_logo_initials.png"></a></li>
            <li class="leftLinks github"><a href="https://github.com/skang28" target="_blank"><img src="https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png"></a></li>
        <div class="menu-toggle">
            <a href="javascript:void(0);" class="icon"><i class="fa fa-bars"></i></a>

No Comments Right Now !

Boards Message :
You Must Login Or Sign Up to Add Your Comments .

Share : facebook icon twitter icon

How do I Split string only at last occurrence of special character and use both sides after split

Tag : chash , By : druta
Date : March 29 2020, 07:55 AM
Hope this helps I want to split a string only at last occurrence of special character. , You can use String.Substring with String.LastIndexOf:
string str = "SQL injection - Wikipedia, the free encyclopedia - Mozilla Firefox";
int lastIndex = str.LastIndexOf('-');
if (lastIndex + 1 < str.Length)
    string firstPart = str.Substring(0, lastIndex);
    string secondPart = str.Substring(lastIndex + 1);
string str = "FirstPart - Mozzila Firefox-somethingWithoutSpace";
string delimiter = " - ";
int lastIndex = str.LastIndexOf(delimiter);
if (lastIndex + delimiter.Length < str.Length)
    string firstPart = str.Substring(0, lastIndex);
    string secondPart = str.Substring(lastIndex + delimiter.Length);
"FirstPart - Mozzila Firefox-somethingWithoutSpace"
Mozzila Firefox-somethingWithoutSpace

Centering navbar pills vertically within the navbar using flexbox

Tag : html , By : chorn
Date : March 29 2020, 07:55 AM
wish help you to fix your issue Set display: flex for the

Remove lines on sides on navbar item

Tag : html , By : TRobison
Date : March 29 2020, 07:55 AM
seems to work fine According to your CODEPEN, your border issue is in the a tag, not the li tag.
Add this to your CSS:
.navbar-custom .navbar-nav > li > a,
.navbar-custom .navbar-nav > li:last-child > a {
     border: none;

How do I fix my navbar to center it and make it even on both sides?

Tag : html , By : Kaputnik
Date : March 29 2020, 07:55 AM
wish helps you The problem arises once I shrink the window down under 500px; I created a media query to change size depending on the size of the display. Unfortunately upon doing this, all the menu items seem to float to the left and there is too much empty space making things unbalanced. I've tried various centering methods but can't identify the issue. As always, help is greatly appreciated. Here are my html css work files:
     @media (max-width: 500px)
nav ul li {
    float: left;
    width: 103px;
    height: 30px;
    line-height: 30px;
    text-align: center;

.navbar {
    width: 100%;
hope this will help you

Why is there a little gap between my navbar and both sides of my page?

Tag : javascript , By : doctorbigtime
Date : March 29 2020, 07:55 AM
will be helpful for those in need Just add a margin: 0px CSS property to your body. There is a default 8px padding on the body which is causing the issue.
body {
  background-color: green;
  margin: 0px;

.navbar {
  overflow: hidden;
  background-color: #333;
  text-align: center;
  width: 100%;

.navbar a {
  float: left;
  font-size: 18px;
  color: white;
  text-align: center;
  padding: 14px 16px;
  text-decoration: none;

.dropdown {
  float: left;
  overflow: hidden;

.dropdown .dropbtn {
  font-size: 18px;  
  border: none;
  outline: none;
  color: white;
  padding: 14px 16px;
  background-color: inherit;
  font-family: inherit;
  margin: 0;

.navefix:hover, .dropdown:hover, .dropbtn {
  background-color: red;
  cursor: pointer;

.dropdown-content {
  display: none;
  position: absolute;
  background-color: #f9f9f9;
  min-width: 160px;
  box-shadow: 0px 8px 16px 0px rgba(0,0,0,0.2);
  z-index: 1;

.dropdown-content a {
  float: none;
  color: black;
  padding: 12px 16px;
  text-decoration: none;
  display: block;
  text-align: left;

.dropdown-content a:hover {
  background-color: #ddd;

.dropdown:hover .dropdown-content {
  display: block;
  <div class="navbar">
      <div class="dropdown">
        <button class="dropbtn" onclick="location.href='index.html'">Index 
        <div class="dropdown-content">
          <a href="page1.html">page1</a>
          <a href="page2.html">page2</a>
          <a href="page3.html">page3</a>
      <a href="page4.html" class="navefix">page4</a>
Related Posts Related QUESTIONS :
  • How to maintain button location regardless of image size
  • How do I position the icon to the right of the heading?
  • Ionic 3 CPF/CNPJ mask
  • Flex Layout not following flex percentages
  • Some images not working in `background-image:url()`
  • How to add an icon preview to a html list of google store apps?
  • How to hide element overflow without cropping inline images/text?
  • Margin-Top is not working for me when attempting to adjust the location of a button
  • When I send a letter to the mail gives an error 'tuple' object has no attribute 'get'
  • How can i intentionally access the "Index of /" page on my local server?
  • Unable to position a image and text side by side using css/html
  • Text not re-displaying on click of button
  • How to use href attribute in a link tag accurately in android?
  • Repeated reference of classes causing text margins to shift
  • Are my home and about links hyperlinking to the right pages?
  • Tinted background image not working with Bootstrap
  • How can I stop my parallax div having a blurred background?
  • CSS hover effect to modify another element is not working
  • why section-testimonial is not placing correctly
  • Why doesn't my media screen query work, I can't make my website responsive?
  • Aligning inline-block elements horizontally
  • How do I display TypeScript code in "<code>" tags in an Angular app?
  • How can I change the color of input tag in a form when focusing on it?
  • How do I put a container in a fixed position with its own overflow?
  • How to fix text-alignment
  • Outlook not displaying a portion of HTML
  • Remove radio button text only with CSS
  • How to use "v-if" in Vue.js to render a <span> only if parent div has a specific property?
  • How to Extract just the Date from Angular Material Datepicker
  • @keyframes not working, I have tried everything i can think of
  • Bootstrap fix form to bottom of the page
  • How to hide a list element in html
  • How to stop repeating image
  • How do I prevent the GET method from encoding HTML special characters in the URI?
  • CSS/HTML: How do I change the color of the check mark within the checkbox input?
  • attaching a file path in a html form
  • Flip <canvas> (rotate 180deg) after being published on page
  • Is there an application I can show a client the speed of their site via differring internet connections?
  • Html / Email / Distribution list problem from a noob
  • Inspiring web experiments and technical demos
  • Can I load javascript code using <link> tag?
  • Lisp-style quotation in HTML
  • How to put text float around image like some newspapers' format using CSS?
  • Technical reasons for not having large background images in websites
  • HTML 5 Structure tags demo
  • Angular - String interpolation of undefined variable
  • Is there any way to edit specific Column of table using mat-table in Angular material
  • How can I set a text as a shadow for a heading element?
  • How to fix the forms making the buttons overlap
  • Splitting XML into multiple HTML pages with XSLT?
  • How to justify empty divs in flex container
  • How to blur in CSS only one layer of when you have multiple layers in background-image?
  • Scrollable html table with fixed first row and first column, along with angular material controls within the cells of ta
  • In Django, how to extract ID attribute from html Input tag, WITHOUT using django forms
  • how to fix link tag in html after changing css
  • How do I add a top padding to the second row?
  • Is it possible to split XML into multiple HTML pages with page navigation?
  • AngularJS: responsive height in bootstrap
  • Hide second line of text with CSS
  • repeating-linear-gradient not working in Edge browser and internet Explorer Browser
  • shadow
    Privacy Policy - Terms - Contact Us © scrbit.com