Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

184
Views
How do I move a list to the right in my navbar? in reactjs and css

I want to move in my navbar a list to the right, as the image below indicates

Image

My navbar.js: the class is navbar-links

import React from "react";
import "./Navbar.css";

const Navbar = ({ isScrolling, information }) => {
    const toTheTop = () => {
        window.scrollTo({ top: 0, left: 0, behavior: "smooth" });
    };

    return (
        <nav className={`navbar ${isScrolling > 20 ? "scrolling" : null}`}>
            <div
                className={`navbar-logo ${
                    isScrolling > 20 ? "scrolling-logo" : null
                }`}
                onClick={toTheTop}
            >
                <p>{information.name}</p>
            </div>

            <div
                className={`navbar-links box ${
                    isScrolling > 20 ? "scrolling-links" : null
                }`}
            >
                <ul>
                    {information.directions.map((direction) => (
                        <li key={direction.key}>
                            <a href={direction.url}>{direction.name}</a>
                        </li>
                    ))}
                </ul>
            </div>
        </nav>
    );
};

export default Navbar;

my Navbar.css: I already tried using display: flex; align-items: center; justify-content: flex-end; But it does not work

.navbar {
    display: flex;
    position: fixed;
    top: 0;
    background-color: transparent;
    width: 100%;
    height: 80px;
    font-size: 20px;
    z-index: 1;
}

.scrolling {
    background-color: #000;
    transition: all 0.5s ease;
}

.navbar-logo {
    display: flex;
    align-items: center;
    padding-left: 50px;
    color: #000;
    cursor: pointer;
}

.scrolling-logo {
    color: #fff;
    transition: all 0.5s ease;
}
/* here is the div of my list */
.navbar-links {
    display: flex;
    align-items: center;
    justify-content: flex-end;
}

.navbar-links > ul {
    display: flex;
    flex-direction: row;
    list-style: none;
}

.navbar-links > ul > li {
    padding: 0 5% 0 5%;
}

.navbar-links > ul > li > a {
    color: #000;
}

.navbar-links > ul > li > a:hover {
    color: #d4d4d4;
}

.scrolling-links > ul > li > a {
    color: #fff;
    transition: all 0.5s ease;
}

for view my code of the my proyect visit my repository https://github.com/Michael-Liendo/michaelliendo.com

about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

You can do it by justify-content: space-between;, but it doesn't work properly now.
Because you set position: fixed; and not set left or right.
So you can do it by this CSS code.

.navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: transparent;
    width: 100%;
    height: 80px;
    font-size: 20px;
    z-index: 1;
}
about 4 years ago · Juan Pablo Isaza Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!