【发布时间】:2020-01-02 13:50:10
【问题描述】:
我希望人们能够通过标签“关注”我的 div。到目前为止,我试过这个:
const Div = styled.div.attrs({
tabindex: '0',
})`
margin: auto;
width: 100%;
max-width: 1200px;
height: 320px;
background: url(${({ rtl }) => determineUrl(rtl)}) no-repeat center;
display: grid;
grid-template-columns: 100%;
grid-template-rows: 100%;
@media (min-width: ${resolutions.min.mobile}px) and (max-width: ${resolutions.max.mobile}px){
max-height: 240px;
}
`;
还有这个:
<Div tabindex={0}>...</Div>
还有
<Div tabindex={"0"}>...</Div>
这些都不行,想不出别的了。
【问题讨论】:
标签: javascript html reactjs styled-components