<IntroWrapper id="intro">어떤 하루를 보내셨나요?</IntroWrapper>
<MoveToWriteWrapper to={"/write"} id="write">3줄일기 쓰러가기</MoveToWriteWrapper>
<NavSection>
<IntroWrapper id="intro">어떤 하루를 보내셨나요?</IntroWrapper>
<MoveToWriteWrapper to={"/write"} id="write">3줄일기 쓰러가기</MoveToWriteWrapper>
</NavSection>
※ 정확한 영역에 hover를 하고 싶으면 한 번 더 감싸주면 됨
const NavSection = styled.div`
display: flex;
border-radius: 100px;
:hover {
#write {
display: block;
#intro {
display: none;
}
}
}
`;
const IntroWrapper = styled.div`
text-align: center;
width: 500px;
background-color: ${colorPick.gray};
color: white;
padding: 10px 0px;
border-radius: 100px;
`;
const MoveToWriteWrapper = styled(Link)`
display: none;
text-align: center;
width: 500px;
position: absolute;
background-color: ${colorPick.purple};
color: white;
padding: 10px 0px;
border-radius: 100px;
cursor: pointer;
text-decoration: none;
&:focus,
&:hover,
&:visited,
&:link,
&:active {
text-decoration: none;
}
`;
ID선택자와 :hover를 이용해 display none과 block사이를 적절하게 만들어 준다.