【发布时间】:2017-02-08 03:11:04
【问题描述】:
我使用 react 并且我的附加 CSS 定义位于 js 文件中作为这样的常量(希望这不是一个坏习惯):
const STYLE = {
logo: {
width: '206px',
height: '73px',
margin: '120px auto 0',
display: 'block'
},
label: {
fontSize: 'x-small'
},
control: {
border: 'solid',
borderWidth: '0 0 1px',
borderColor: '#E0E0E0',
width: '200px'
}
};
export default class Home extends React.Component {
render() {
return (
<div>
<img src='.../logo.gif' style={STYLE.logo}/>
<FormGroup>
<Col smOffset=...>
<Form horizontal>
<FormGroup>
<Col sm=... style={STYLE.label}>
Label:
<input style={STYLE.control} type="text"/>
</Col>
</FormGroup>
</Form>
</Col>
</FormGroup>
</div>
)
}
}
我想用 CSS 移除输入组件周围的边框。我需要将以下 css 添加到我的 STYLE.control:
input:focus {
outline:none;
}
但我不知道该怎么做,因为(当然)这不起作用:
const STYLE = {
noBorder: {
input:focus: 'outline:none'
}
};
【问题讨论】: