改变角度材料中md-switch的大小

时间:2016-04-07 14:35:23

标签: css angular-material

我正在使用Angular材料的md-switch:

https://material.angularjs.org/latest/demo/switch

但默认开关看起来很小,我想调整它的大小。

我尝试添加widthheight属性,但它没有用。

我该怎么做?

1 个答案:

答案 0 :(得分:0)

使用此规则自定义栏:

md-switch ._md-bar {
    left: 1px;
    width: 66px;
    top: 5px;
    height: 14px;
    border-radius: 8px;
    position: absolute;
}

这个规则要花圆圈:

md-switch ._md-thumb {
    position: absolute;
    margin: 0;
    left: 0;
    top: 0;
    outline: none;
    height: 20px;
    width: 20px;
    border-radius: 50%;
    box-shadow: 0px 1px 3px 0px rgba(0, 0, 0, 0.2), 0px 1px 1px 0px rgba(0, 0, 0, 0.14), 0px 2px 1px -1px rgba(0, 0, 0, 0.12);
}

<强> LIVE DEMO