首頁 > 問答 > 主體
P粉0927785852023-08-19 11:02:21
要更改複選框的大小,請在styles.scss中加入以下CSS程式碼:
styles.scss
1
2
3
4
.mdc-checkbox__background {
width: 1.5rem !important;
height: 1.5rem !important;
}
但是,如果您想使用預設的漣漪效果,這只是解決方案的一半。現在您還需要對齊複選框,使其完美地適應漣漪效果的圓圈中。請在styles.scss中加入以下CSS程式碼:
5
6
7
top: 50% !important; /* 添加 */
top: 50% !important;
/* 添加 */
left: 50% !important; /* 添加 */
left: 50% !important;
transform: translate(-50%, -50%) !important; /* 添加 */
transform: translate(-50%, -50%) !important;
請參考即時示範。