【问题标题】:Apply css for <html> when click on button in angular单击角度按钮时为 <html> 应用 css
【发布时间】:2022-01-14 22:06:28
【问题描述】:

我想为整个页面显示隐藏的滚动条。但是当我点击按钮时它转到下一页并且滚动条应该是可见的。

https://stackblitz.com/edit/angular-ftdwez?file=src%2Fapp%2Fapp.component.html

【问题讨论】:

    标签: html css angular typescript


    【解决方案1】:

    在条件下使用 CSS 溢出属性。

    根据 stackbliz 示例

    <p style="overflow:hidden"></p>
    

    用户默认隐藏,点击make时隐藏

    overflow:scroll
    

    使用,

    [ngClass]="step == 'step1' ? 'my_class1' : 'my_class2'"
    

    【讨论】:

      猜你喜欢
      • 2018-06-12
      • 1970-01-01
      • 2017-12-14
      • 2018-08-22
      • 1970-01-01
      • 2020-06-05
      • 1970-01-01
      • 2021-12-21
      • 2021-02-12
      相关资源
      最近更新 更多