【发布时间】:2018-07-30 13:01:02
【问题描述】:
我想知道如何更改出现在文本区域中的内边框颜色。我想删除文本区域红色边框内的蓝色透明边框。我检查了 modena.css 文件,但找不到解决方案。
我的 css 文件中有什么:
.text-area:focused {
-fx-background-color: white;
-fx-border-color: rgba(229,0,0,0.3);
}
【问题讨论】:
我想知道如何更改出现在文本区域中的内边框颜色。我想删除文本区域红色边框内的蓝色透明边框。我检查了 modena.css 文件,但找不到解决方案。
我的 css 文件中有什么:
.text-area:focused {
-fx-background-color: white;
-fx-border-color: rgba(229,0,0,0.3);
}
【问题讨论】:
TextArea 在其内容上有一个额外的边框/背景。要更改/摆脱它,您需要在 css 中添加一个附加样式。
类似
.text-area:focused .content {
-fx-background-color: white;
}
不确定这是否足够安全:它是not documented(或者至少我找不到任何文档),只能作为实现使用,f.i.在提取的modena.css
【讨论】:
我使用下面的代码来摆脱文本区域自动生成的焦点效果:
* {
-fx-focus-color: transparent;
-fx-border-style: none;
}
或
.textarea {
-fx-focus-color: transparent;
-fx-border-style: none;
-fx-background-radius: 0.0px;
-fx-border-radius: 0.0px;
}
摆脱所有默认样式,包括圆角边框...
【讨论】: