1

可能是什么原因,以下构造没有注意到以下媒体查询?

<Drawer
    id={this.props.id + 'WhateverMenu'}
    key={this.props.id + 'WhateverMenu'}
    docked={false}
    onRequestChange={this.handleToggle.bind(this)}
    width={300}
    openSecondary={true}
    open={this.state.DrawerWhateverOpen}
    containerStyle={
        {
            '@media only screen and (minWidth: 768px)': {top: '112px'},
            top: '0px'
        }

    }
>

top: '0px'有效,媒体查询被忽略。另一种可能性:

containerStyle = {
    {
        '@media only screen and (maxWidth: 767px)': {top: '0px'},
        top: '112px'
    }
}

也不起作用。我也试过了max-width / min-width,这也不是原因。

有人能帮我吗?

4

0 回答 0