Ale*_*ide 1 html javascript reactjs styled-components
我希望人们能够通过选项卡“关注”我的 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;
}
`;
Run Code Online (Sandbox Code Playgroud)
和这个:
<Div tabindex={0}>...</Div>
Run Code Online (Sandbox Code Playgroud)
也
<Div tabindex={"0"}>...</Div>
Run Code Online (Sandbox Code Playgroud)
这些都行不通,也想不出别的办法了。