admin管理员组文章数量:1317906
I want to modify the default style of a Menu Item (which has a Search Bar inside it), I want to remove the border-bottom property which is appeared by hovering over the item (search bar)
<Menu theme='light' className='nav-bar' mode='horizontal'>
<Menu.Item disabled style={{ color: '#262626', fontSize: '1.5rem' }}>
{/* <Title style={{color: '#40a9ff'}} level={4}>Dokan</Title> */}
Dokan
</Menu.Item>
<Menu.Item className="modified-item">
<Search
placeholder='input search text'
onSearch={(value) => console.log(value)}
/>
</Menu.Item>
<Menu.Item className>Change Theme</Menu.Item>
<Menu.Item className>Home</Menu.Item>
<Menu.Item className>Checkout</Menu.Item>
</Menu>
what I have tried is:
.modified-item:hover {
border-bottom: none;
}
but it didn't work.
I want to modify the default style of a Menu Item (which has a Search Bar inside it), I want to remove the border-bottom property which is appeared by hovering over the item (search bar)
<Menu theme='light' className='nav-bar' mode='horizontal'>
<Menu.Item disabled style={{ color: '#262626', fontSize: '1.5rem' }}>
{/* <Title style={{color: '#40a9ff'}} level={4}>Dokan</Title> */}
Dokan
</Menu.Item>
<Menu.Item className="modified-item">
<Search
placeholder='input search text'
onSearch={(value) => console.log(value)}
/>
</Menu.Item>
<Menu.Item className>Change Theme</Menu.Item>
<Menu.Item className>Home</Menu.Item>
<Menu.Item className>Checkout</Menu.Item>
</Menu>
what I have tried is:
.modified-item:hover {
border-bottom: none;
}
but it didn't work.
Share Improve this question asked Jul 22, 2020 at 10:36 AshikAshik 3,44812 gold badges39 silver badges65 bronze badges 3- Instead of assigning class to Menu item, assign it to search box. Then apply the css. See if it works – CaffeinatedCod3r Commented Jul 22, 2020 at 10:40
- applied but didn't work. – Ashik Commented Jul 22, 2020 at 10:46
-
Try with
!important
. If still didnt work then check in dev tools why it is appearing – CaffeinatedCod3r Commented Jul 22, 2020 at 10:47
5 Answers
Reset to default 3.ant-menu-horizontal > .ant-menu-item::after,
.ant-menu-horizontal > .ant-menu-submenu::after {
border-bottom: none !important;
transition: none !important;
}
border-bottom: none;
is not a style option that exists in css.
try
border-bottom-style: none;
or
opacity: 0;
Instead of using className in Menu.Item use style property
<Menu.Item style={{borderBottom:'none'}}>
<Search
placeholder='input search text'
onSearch={(value) => console.log(value)}
/>
</Menu.Item>
.ant-menu-item:hover::after {
border-bottom: none !important;
}
This will work
Add Style to Your Menu Tag as below
<Menu
onClick={this.handleClick}
selectedKeys={[current]}
mode="horizontal"
className="pb-3 pl-3 pt-3"
style={{borderBottom: "none", lineHeight:"0px"}}
>
本文标签: javascriptAnt Design How can I disable borderbottom of a menu item on hoverStack Overflow
版权声明:本文标题:javascript - Ant Design: How can I disable border-bottom of a menu item on hover? - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1742030375a2416332.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论