gpt4 book ai didi

css - 如何更改 :focus? 上输入/文本区域的边框颜色

转载 作者:行者123 更新时间:2023-11-28 04:25:00 25 4
gpt4 key购买 nike

我使用 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'
}
};

最佳答案

render() {
return (
<div>
<style>
input:focus {
outline: none;
}
</style>

关于css - 如何更改 :focus? 上输入/文本区域的边框颜色,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/42013947/

25 4 0
文章推荐: css - 不同页面上的相同页脚 div 看起来不同
文章推荐: c++ - CMAKE_WINDOWS_EXPORT_ALL_SYMBOLS 不覆盖全局变量
文章推荐: html - 是否可以在不将其复制并粘贴到每个页面的情况下创建网站标题?
文章推荐: html - 如何将此
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com