我有這個分量陣營JSX元素不繼承「ID」樣式屬性
// @flow
import React, { Component } from 'react';
import { Link } from 'react-router';
import styles from './Counter.css';
class Counter extends Component {
props: {
activate:() => void,
counter: number
};
render() {
const { activate, counter } = this.props;
return (
<div className = { styles.container}>
<div id="top-menu" className="ui secondary menu">
<a className="active item">
Home
</a>
<a className="item">
Messages
</a>
<a className="item">
Friends
</a>
<div className="right menu">
<a className="ui item">
Logout
</a>
</div>
</div>
<input type = "text" placeholder = "Enter activation key" className = {styles.input} />
<button className = { styles.btn } onClick = { activate } > < i className = "btn"/>lala</button>
</div>
);
}
}
export default Counter;
正如你可以看到我輸入「Counter.css」到款式可變 ,每當我給你一些HTML元素,它繼承了'Counter.css'中的樣式。但是,我有一個規則#top-menu
在這個CSS文件中沒有被分配到這個元素。有沒有辦法從這種方式繼承css的id定義的規則?
請發表回覆Counter.css –