简体   繁体   English

如何增加 AngularJS Material 中单选按钮选择的大小?

[英]How do I increase the size of a radio button selection in AngularJS Material?

I want to make the area where the click is detected bigger as shown in this image .我想使其中检测点击放大如图所示的区域这一形象

I want to make it so that no matter where you click inside that red region you will select the radio button.我想让它无论您在红色区域内的何处单击,都将选择单选按钮。

I've managed to make that area selectable with the CSS style Padding:我已经设法使用 CSS 样式 Padding 使该区域可选:

$scope.myObj = {
  "padding": "20px",
}

The HTML looks like this: HTML 如下所示:

    <md-radio-button ng-style="myObj"></md-radio-button>

But this creates another issue, I want the circle of the radio button to be centered inside that area, like this image .但这会产生另一个问题,我希望单选按钮的圆圈在该区域内居中,就像这个图像一样

Is there a way to center the radio button inside the region and keep the padding or is there any other way to increase the clickable area and keep the button centered?有没有办法将单选按钮在区域内居中并保持填充,或者有没有其他方法可以增加可点击区域并保持按钮居中?

You can do your own if you want, see example:如果你愿意,你可以自己做,参见示例:

 .btn-padding { background: lime; padding: 14px; }
 <md-radio-button ng-style="myObj" class="btn-padding">Write Text</md-radio-button>

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM