Here I want to use two style in one line css. but i got error how i add two style object in style tag reactjs. here is my code:
const style = {
color:"black",
fontSize:16,
borderRadius:4,
border: "1px solid grey",
lineHeight: "28px",
background: "white",
padding: 3,
margin:3
}
const hoverStyle = {
color:"black",
fontSize:16,
borderRadius:4,
border: "1px solid grey",
lineHeight: "28px",
background: "yellow",
padding: 3,
margin:3
}
const highlightStyle = {
color:"black",
fontSize:16,
border: "1px solid grey",
background:"lightblue",
borderRadius:4,
lineHeight: "25px",
padding: 3,
margin:5
}
onHover(){
console.log("mouse enter")
// this.setState({hover:!this.state.hover})
}
<span id={this.props.atId} className = {this.props.classword}
style={this.state.color_black ? style: highlightStyle,this.state.hover ? hoverStyle: ''}
onClick={this.changeColor}
onMouseEnter={() => {this.onHover()}}
onMouseLeave={() => {this.onUnHover()}}
//
>
{item}
</span>