html - 如何使用 Angular Material 或 Angular 制作图像中给出的底部栏?

标签 html css angular-material angular7

我正在创建 Angular 7 应用程序并设计 UI。我想修复底部栏,如下图所示。只需要中间的圆形图标留下其他东西。 here is the bottom bar image

最佳答案

您可以使用 mat-toolbar、fab-button、div 和样式制作自定义组件:

组件模板:

<div class="fab-wrapper">
  <button mat-button mat-fab>
    <mat-icon>add</mat-icon>
  </button>
</div>
<mat-toolbar color="primary">
  <ng-content></ng-content>
</mat-toolbar>

组件 SASS:

:host {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  margin-top: -36px;

  .fab-wrapper {
    width: 56px;
    height: 56px;
    position: relative;
    top: 36px;
    left: calc(50% - 36px);
    padding: 8px;
    border-radius: 36px;
    background-color: white;
  }
}

这应该让您朝着正确的方向开始。

关于html - 如何使用 Angular Material 或 Angular 制作图像中给出的底部栏?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/58327919/

相关文章:

Angular Material 显示两条错误消息

html - 表格单元格在行内右对齐

html - 为什么不应用 flex-basis 尺寸?

javascript - 谷歌浏览器固定位置和边距顶部的问题

jquery - 如何添加指向 Bootstrap 选择选项的链接

angularjs - 在自动完成 Material Angular 的建议列表中添加带有链接的页脚

html - 如何让我的栏目内容并排显示

javascript - 多次将同一项目添加到 Canvas 上

javascript - 通过 .this 在类中只选择一个 div 不起作用

angularjs - 传单 map 的大小不适合目标元素的尺寸