如何实施“添加”#39;正如我在许多Google网络应用中看到的那样,右下方的FAB?

时间:2016-03-23 16:16:40

标签: html css material-design angular-material

我正在尝试在我的网络应用的右下角实施FAB 。手动CSS是唯一的方法吗?我在https://material.angularjs.org上没有看到任何相关文档。

这是我想要实现的示例(右下角的红色按钮):

FAB add button on bottom right

3 个答案:

答案 0 :(得分:9)

我刚刚找到答案:

<md-button class="md-fab md-fab-bottom-right" aria-label="Add a category">
  <md-icon>add</md-icon>
</md-button>

我必须添加md-fab-bottom-right的类名。

答案 1 :(得分:2)

CSS的主要规则是“正确”;为了增加Luis的答案,请将以下规则添加到CSS:

.md-fab-bottom-right{
    position: fixed !important;
    right: 15px; /* Add this and change value to set the margin you want */
}

答案 2 :(得分:1)

改善你的问题:如果按钮的位置有问题,请将其添加到你的css:

.md-fab-bottom-right{
    position: fixed !important;
}

这样,即使用户滚动

,按钮也会固定