well i have been stragling to align all the items of the navbar next to each other couldn’t see where the problem is i tried to fix the size of the logo but it didn t work and the elements remaind on top of each other
here the css code
/************ Default Css ************/
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
html {
scroll-behavior: smooth;
scroll-padding-top: 75px;
}
body {
font-weight: 400;
overflow-x: hidden;
position: relative;
background-color: #121212 !important;
color: #fff !important;
font-family: 'Centra', sans-serif !important;
}
h1, h2, h3, h4, h5, h6 {
margin: 0;
padding: 0;
line-height: normal;
}
p, a, li, button, ul {
margin: 0;
padding: 0;
line-height: normal;
text-decoration: none;
}
a:hover {
text-decoration: none;
}
img {
width: 100%;
height: auto;
}
button {
border: 0;
background-color: transparent;
}
input:focus, textarea:focus, select:focus {
outline: none;
}
@media (min-width:1700px) {
main .container {
max-width: 100%;
padding: 0 150px;
}
}
p.success {
color: green;
}
p.danger {
color: red;
}
/************ Navbar Css ************/
nav.navbar {/*Styles the overall navbar container*/
padding: 18px 0;
position: fixed;
width: 100%;
top: 0;
z-index: 9999;
transition: 0.32s ease-in-out;
display: flex;
justify-content: space-between;
align-items: center;
padding: 18px 20px;
}
nav.navbar.scrolled {
padding: 0px 0;
background-color: #121212;
}
nav.navbar a.navbar-brand {/*Styles the logo container (Navbar.Brand)*/
width: 0;
}
nav.navbar .navbar-nav .nav-link.navbar-link {/*Styles individual navigation links*/
font-weight: 400;
color: #fff !important;
letter-spacing: 0.8px;
padding: 0 25px;
font-size: 18px;
opacity: 0.75;
}
/*effects hover */
nav.navbar .navbar-nav a.nav-link.navbar-link:hover,
nav.navbar .navbar-nav a.nav-link.navbar-link.active {
opacity: 1;
}
span.navbar-text {
display: flex;
align-items: center;
}
.social-icon {
display: inline-block;
margin-left: 14px;
}
.social-icon a {
width: 42px;
height: 42px;
background: rgba(217, 217, 217, 0.1);
display: inline-flex;
border-radius: 50%;
margin-right: 6px;
align-items: center;
justify-content: center;
line-height: 1;
border: 1px solid rgba(255, 255, 255, 0.5);
}
.social-icon a::before {
content: "";
width: 42px;
height: 42px;
position: absolute;
background-color: #ffffff;
border-radius: 50%;
transform: scale(0);
transition: 0.3s ease-in-out;
}
.social-icon a:hover::before {
transform: scale(1);
}
.social-icon a img {
width: 40%;
z-index: 1;
transition: 0.3s ease-in-out;
}
.social-icon a:hover img {
filter: brightness(0) saturate(100%) invert(0%) sepia(7%) saturate(98%) hue-rotate(346deg) brightness(95%) contrast(86%);
}
.navbar-text button {
font-weight: 700;
color: #fff;
border: 1px solid #fff;
padding: 18px 34px;
font-size: 18px;
margin-left: 18px;
position: relative;
background-color: transparent;
transition: 0.3s ease-in-out;
}
.navbar-text button span {
z-index: 1;
}
.navbar-text button::before {
content: "";
width: 0%;
height: 100%;
position: absolute;
background-color: #fff;
left: 0;
top: 0;
z-index: -1;
transition: 0.3s ease-in-out;
}
.navbar-text button:hover {
color: #121212;
}
.navbar-text button:hover::before {
content: "";
width: 100%;
height: 100%;
position: absolute;
}
nav.navbar .navbar-toggler:active,
nav.navbar .navbar-toggler:focus {
outline: none;
box-shadow: none;
}
nav.navbar .navbar-toggler-icon {
width: 24px;
height: 17px;
background-image: none;
position: relative;
border-bottom: 2px solid #fff;
transition: all 300ms linear;
top: -2px;
}
nav.navbar .navbar-toggler-icon:focus {
border-bottom: 2px solid #fff;
}
nav.navbar .navbar-toggler-icon:after,
nav.navbar .navbar-toggler-icon:before {
width: 24px;
position: absolute;
height: 2px;
background-color: #fff;
top: 0;
left: 0;
content: '';
z-index: 2;
transition: all 300ms linear;
}
nav.navbar .navbar-toggler-icon:after {
top: 8px;
}
nav.navbar .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:after {
transform: rotate(45deg);
background-color: #fff;
height: 2px;
}
nav.navbar .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon:before {
transform: translateY(8px) rotate(-45deg);
background-color: #fff;
height: 2px;
}
nav.navbar .navbar-toggler[aria-expanded="true"] .navbar-toggler-icon {
border-color: transparent;
}
and this the navbar component
return (
<Navbar expand="md" className={scrolled ? "scrolled" : ""}>
<Container>
<Navbar.Brand href="/">
<img src={logo} alt="Logo" />
</Navbar.Brand>
<Navbar.Toggle aria-controls="basic-navbar-nav">
<span className="navbar-toggler-icon"></span>
</Navbar.Toggle>
<Navbar.Collapse id="basic-navbar-nav">
<Nav className="ms-auto">
<Nav.Link href="#home" className={activeLink === 'home' ? 'active navbar-link' : 'navbar-link'} onClick={() => onUpdateActiveLink('home')}>Home</Nav.Link>
<Nav.Link href="#skills" className={activeLink === 'skills' ? 'active navbar-link' : 'navbar-link'} onClick={() => onUpdateActiveLink('skills')}>Skills</Nav.Link>
<Nav.Link href="#projects" className={activeLink === 'projects' ? 'active navbar-link' : 'navbar-link'} onClick={() => onUpdateActiveLink('projects')}>Projects</Nav.Link>
</Nav>
<span className="navbar-text">
<div className="social-icon">
<a href="#"><img src={navIcon1} alt="" /></a>
<a href="#"><img src={navIcon2} alt="" /></a>
<a href="#"><img src={navIcon3} alt="" /></a>
</div>
<button className="vvd"><span>Let’s Connect</span></button>
</span>
</Navbar.Collapse>
</Container>
</Navbar>
)
i m expecting all items like logo links and icons to be aligned
current situation
New contributor
emir fenina is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.