html中的边框重叠代码,CSS-圆角边框看起来像两个重叠的按钮

{

-fx字体大小:12pt;

-fx文本填充:白色;

-fx背景色:黑色;

-fx pref宽度:200px;

-fx pref高度:40px;

-fx最小高度:fx pref高度;

-fx max height:-fx pref height;

-fx背景半径:20px;

-fx边界半径:20px;

-fx边框颜色:白色;

}

< /代码>

dhxwb.png%E2%80%9Dalt=%E2%80%9Cresult财产。按钮角上的白色“圆点”让我怀疑这一点。

但是,以下各项应达到所需的性能:

@Override

public void start(Stage primaryStage) {

VBox vbox = new VBox();

vbox.setStyle("-fx-background-color: blue;");

for (int i = 0; i < 4; i++) {

Button button = new Button(Integer.toString(i));

button.getStyleClass().setAll("button");

vbox.getChildren().add(button);

}

Scene scene = new Scene(vbox);

scene.getStylesheets().add("style.css");

primaryStage.setScene(scene);

primaryStage.show();

}

样式表

.button {

-fx-font-size: 12pt;

-fx-text-fill: white;

-fx-background-color: black;

-fx-pref-width: 200px;

-fx-pref-height: 40px;

-fx-min-height: -fx-pref-height;

-fx-max-height: -fx-pref-height;

-fx-background-radius: 20px;

-fx-border-radius: 20px;

-fx-border-color: white;

}

dhXwb.png

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值