尝试使用' zindex'道具,如下所示: https://github.com/facebook/react/issues/1456
<Input ref="username" type="text" label="Username"
placeholder="Enter username" zindex={1} />
不起作用。还尝试了&#39; zindex =&#34; 1&#34;&#39;
有什么想法吗?
答案 0 :(得分:10)
您需要使用style = {}构造进行分配。试试这个:
<Input ref="username" type="text" label="Username" placeholder="Enter username" style={{zIndex:1}} />
答案 1 :(得分:1)
尝试一下...
style={{zIndex: '100'}}
答案 2 :(得分:1)
始终记住使用骆驼箱。 zindex变为zIndex。 margin-right变成marginRight。
您必须调用样式。 样式= {{zIndex = 1}}
您可能希望传递相对或绝对值。
<div style={{ position: 'relative', zIndex: '1' }}>
bottom
</div>
<div style={{ position: 'relative', zIndex: '2' }}>
top
</div>
答案 3 :(得分:-1)
when you are applying z-index then definitely you are trying to priorities your new part of code. So you also need to check if there are any other z-index with higher value which might be restricting your new z-index value
<Input ref="username" type="text" label="Username"
placeholder="Enter username" class = "applyZIndex" />
.applyZIndex {
z-index : 1;
}