我有一个样式化的组件modal,它有几个div作为child。我需要在第二层设计这个div。
<StyledComponentModal>
<div>
<div> // <-- This one needs styling
// ...
</div>
</div>
</StyledComponentModal
我该怎么选择呢
div
?
我试着用
div div
:
const Modal = styled(MyModal)`
background: transparent;
height: auto;
margin: ${rem(0)} auto;
margin-top: 25vh;
width: 90vw;
div div {
/* doesn't work :( */
}
`;
我还试过其他东西,比如
&div div
等等,但无法让它发挥作用。
我该如何选择和设计该div?