【问题标题】:To avoid components overlapping in angular避免组件在角度上重叠
【发布时间】:2018-09-25 17:49:03
【问题描述】:

我有两个名为 customer-detailscustomer-bookings 的组件,它们在 app.component.html 文件中由它们的选择器调用,如下代码所示

     <app-customer-details></app-customer-details>
     <app-customer-bookings></app-customer-bookings>

组件应如下所示(即一个在另一个之下)。

但它是这样重叠的。

在这里我遇到了重叠的问题,我尝试通过将每个组件的 height 设置为 50vh 来解决它。但我想在不手动设置高度的情况下解决这个重叠问题。

这是stackblitz 链接。

【问题讨论】:

  • 从您的 customer-details.component.css 中删除 table{ position:absolute; }
  • 非常感谢。

标签: css angular angular-material


【解决方案1】:

您应该从表格样式中删除它:

position:absolute;

在 customer-details.component.css 中

【讨论】:

    【解决方案2】:

    注意与组件有关。 只需修改 CSS。

    table{
      /* position:absolute; */
    }

    【讨论】:

      猜你喜欢
      • 2014-03-17
      • 2018-11-25
      • 1970-01-01
      • 2018-02-12
      • 2020-08-07
      • 1970-01-01
      • 1970-01-01
      • 2011-08-27
      • 2012-12-18
      相关资源
      最近更新 更多