【问题标题】:Aligning two components horizontally in Angular9在Angular 9中水平对齐两个组件
【发布时间】:2020-10-30 17:25:16
【问题描述】:

我有两个组件。一种是搜索表单,一种是搜索表单结果。点击搜索表单中的按钮,显示搜索结果组件。 目前它是垂直的。我想要的是在搜索表单旁边显示搜索结果(水平)。

在搜索表单 html 中,我将引导网格设为 4,在搜索结果中,我给出了 8。

我尝试将通用 div 类放入全局 style.css 并将其设置为 display: inline-block 但没有运气。

我的第一个组件是引导表单。我的第二个组件是 PrimeNG 数据表。

我尝试了什么?

Component 1 templateUrl : 'component1.html' > div classes to create a search form and parent div having test as class
Component 2 tempalteUrl : 'component2.html' > div classes to create a primeNG data table and div having test as class
Global style.css > .test {display: inline-block} so that I can align them horizontally.

编辑

我尝试过的上述方法无法正常工作。我正在添加即将推出的示例输出插图。

我真的想要它

【问题讨论】:

    标签: css layout primeng angular-components angular9


    【解决方案1】:

    也许您需要添加宽度百分比,例如:' width: 19%; '

    【讨论】:

      猜你喜欢
      • 2019-05-26
      • 1970-01-01
      • 2019-12-02
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-23
      • 2020-07-03
      • 2020-12-20
      相关资源
      最近更新 更多