2016-11-18 6 views
1

次のCSSを適用します。シェイプのCSSはjavafxのテキストエリアには適用されません

.text-area .content { 
    -fx-background-color: -lined-back; 
    -fx-shape: "M 7 0 L 24 0 L 24 19 L 0 19 L 0 2 L 7 2 Z"; 
} 

.text-area:focused .content { 
    -fx-shape: "M 7 0 L 24 0 L 24 19 L 0 19 L 0 2 L 7 2 Z"; 
} 

私の問題はそれだけでも、画像の下あたりpoint.asを開始する時に編集を開始バックグラウンド全体ではないcomponent.andの形状を変更していますです。 enter image description here

答えて

1

これらのスタイルが適用されますか?私はjavafxについて何も知りませんが、現在.content.text-areaの内側に向けています。あなたはおそらくちょうど.text-area自体をターゲットにする必要があります:私は、その子は、その形状によって制約されるだろうと想像するから

.text-area, 
.text-area .content { 
    -fx-background-color: -lined-back; 
    -fx-shape: "M 7 0 L 24 0 L 24 19 L 0 19 L 0 2 L 7 2 Z"; 
} 

.text-area:focused, 
.text-area:focused .content { 
    -fx-shape: "M 7 0 L 24 0 L 24 19 L 0 19 L 0 2 L 7 2 Z"; 
} 

は、あなたも、のみターゲット.text-areaにできる可能性があります。

.text-area { 
    -fx-background-color: -lined-back; 
    -fx-shape: "M 7 0 L 24 0 L 24 19 L 0 19 L 0 2 L 7 2 Z"; 
} 

.text-area:focused { 
    -fx-shape: "M 7 0 L 24 0 L 24 19 L 0 19 L 0 2 L 7 2 Z"; 
} 
+0

回答ありがとうございます。テキストエリアの境界にのみ適用されますが、編集は開始から開始されます。 – CTN

関連する問題