I am just getting started with react and I'm in the process of creating my own personal website. The current design of the navbar is shown below.
https://i.sstatic.net/2vPhy.png
I would like to update it to have a similar appearance to this:
https://i.sstatic.net/nbD62.png
Here is the code snippet from my index.js
:
const Navbar = () => {
return (
<>
<Nav>
<NavbarContainer>
<NavLogo to='/'>Devang Mukherjee</NavLogo>
<MobileIcon>
<FaBars />
</MobileIcon>
<NavMenu>
<NavItem>
<NavLinks to='about'>About</NavLinks>
</NavItem>
<NavItem>
<NavLinks to='experience'>Experience</NavLinks>
</NavItem>
<NavItem>
<NavLinks to='skills'>Skills</NavLinks>
</NavItem>
<NavItem>
<NavLinks to='blog'>Blog</NavLinks>
</NavItem>
<NavBtn>
<NavBtnLink to="/contactme"> Contact Me</NavBtnLink>
</NavBtn>
</NavMenu>
</NavbarContainer>
</Nav>
</>
)
}
I am utilizing react styled components such as Nav
,NavbarContainer
,NavBtnLink
,NavItem
,NavBtn
,NavLinks
export const Nav = styled.nav`
background: #000;
height: 80px;
/* margin-top: -80px;*/
display: flex;
justify-content: center;
align-items: center;
font-size: 1rem;
position: sticky;
top: 0;
z-index: 10;
@media screen and (max-width: 960px) {
transition: 0.8s all ease;
}
`;
export const NavbarContainer = styled.div`
display: flex;
justify-content: space-between;
align-items: center;
height: 80px;
z-index: 1;
width: 100%;
padding: 0 24px;
max-width: 1100px;
`;
export const NavItem = styled.li`
height: 80px;
`;
export const NavBtn = styled.nav`
display: flex;
align-items: center;
@media screen and (max-width: 768px) {
display: none;
}
`;
export const NavLinks = styled(LinkS)`
color: #fff;
display: flex;
align-items: center;
text-decoration: none;
padding: 0 1rem;
height: 100%;
cursor: pointer;
&.active {
border-bottom: 3px solid #01bf71;
}
`;
export const NavBtnLink = styled(LinkR)`
border-radius: 50px;
background: #01bf71;
white-space: nowrap;
padding: 10px 22px;
//margin-left: 222px;
color: #010606;
font-size: 16px;
outline: none;
border: none;
cursor: pointer;
transition: all 0.2s ease-in-out;
text-decoration: none;
&:hover {
transition: all 0.2s ease-in-out;
background: #fff;
color: #010606;
}
`;
Is there a way for me to adjust the spacing between "Blog" and "Contact Me" to match the second image, while keeping it responsive?