score:3
Accepted answer
You are missing a space after .navbar-inverse
as .navbar-nav
is a child:
.navbar-inverse .navbar-nav > li > a:hover {
background-color: gray;
}
Running example:
const { Navbar, Nav, NavItem, NavDropdown, MenuItem } = ReactBootstrap;
class App extends React.Component {
render() {
return (
<div>
<Navbar inverse collapseOnSelect className="nav-bar">
<Navbar.Header>
<Navbar.Brand>
<a href="#">efrt</a>
</Navbar.Brand>
<Navbar.Toggle />
</Navbar.Header>
<Navbar.Collapse>
<Nav>
<NavItem eventKey={1} href="#">
Features
</NavItem>
<NavItem eventKey={2} href="#">
Who we Are
</NavItem>
</Nav>
<Navbar.Form pullRight />
<Nav pullRight>
<NavDropdown eventKey={3} title="Signup" id="basic-nav-dropdown">
<MenuItem eventKey={3.3}>Member</MenuItem>
<MenuItem divider />
<MenuItem eventKey={3.3}>Coach</MenuItem>
</NavDropdown>
</Nav>
</Navbar.Collapse>
</Navbar>
</div>
);
}
}
ReactDOM.render(<App />, document.getElementById("root"));
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" rel="stylesheet" />
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react/15.1.0/react-dom.min.js"></script>
<script src="https://cdnjs.cloudflare.com/ajax/libs/react-bootstrap/0.31.3/react-bootstrap.min.js"></script>
<style>
.navbar-inverse .navbar-nav>li>a:hover {
background-color: green;
}
</style>
<div id="root"></div>
Source: stackoverflow.com
Related Query
- React Bootstrap, Adding Hover Effects to NavItems
- React-Bootstrap, Adding Hover Effects to NavItems
- React JS toggle/ adding a class on hover
- Adding a icon to React Bootstrap Dropdown
- react bootstrap - adding custom bsStyle property to button
- how to show options on hover in react bootstrap
- React Bootstrap - Adding logic to a button
- adding active class bootstrap carousel at repeat data just on first key in react app
- Adding hovering effects with a timeout in React
- What is the React way of adding active class and removing others on hover in li elements
- Adding serial number to the react bootstrap table
- Set Card content visible only on hover with Gatsby + Bootstrap React + scss module
- Adding HTML markup in react bootstrap tooltip
- Adding Bootstrap CSS along with CSS Module in classname in React
- adding slide effect in react bootstrap accordion component
- React Bootstrap adding into a component - cards
- Adding an .env file to React Project
- Adding Google Analytics to React
- What is the correct way of adding a dependency to react in your package.json for a react component
- React bootstrap not styling my react components
- Adding border only to the one side of the <Text/> component in React Native (iOS)
- React - adding class to children components
- Rendering a React component inside a Bootstrap popover
- Adding a new line in a JSX string inside a paragraph - React
- Facing issue while adding radio button in react - input is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`
- Bootstrap Dropdown not working in React
- How to make a Bootstrap dropdown with React
- Can I use React Bootstrap with Next.js?
- React Typescript - Adding custom attribute
- React Redux - Is adding async method in a Reducer an anti pattern?
More Query from same tag
- Redux match.params not working after updating state
- Do I have to wrap components in html tags?
- How to add inline style to React component as prop?
- How to create a proxy in React/Webpack to call an external API
- useState and splice react
- React Select Control
- How do I write a an If statement in a react component?
- Action Icons appearing as plain text
- UseState renders me the previous state
- React sinon/enzyme simulate click on es6 class function
- Why to pass callbacks in React component's props instead of using react-redux's connect?
- How to Format Jsx back too what it used to be
- Reactjs - antd table filter as a react class
- On hover for dates - react-dates library
- React Query Firestore Data
- useEffect break array of useState at first time
- Redux state undefined when mapping state to props in react
- Why do I have to click Submit button TWICE in order to update my useState() hook?
- How to round off to 2 decimal places with format SI prefix?
- can i restrict user of website(like online test website) to change tabs?
- Preserve hook types when using array destructuring
- React/Redux - Passing JSON data from one API call to another Redux action using Thunk
- How to create dynamic star rating based on value in array object?
- How to avoid complex hierarchies in reactjs index
- React: Accessing an objects properties within an array that I have mapped
- Get orderable fields - Django Rest
- Centering Semantic UI Column Contents
- Which is really immutable in redux data or state or both?
- How to get data out of mongodb in actual webpage using node js, reactjs, express
- how to only change display when submit button is pressed and not when search is changed