代码之家  ›  专栏  ›  技术社区  ›  Kgn-web

angular-<div ngcontent-c0>不继承父级div width

  •  1
  • Kgn-web  · 技术社区  · 6 年前

    我正在构建 asp.net mvc application with angular 5 am p;here is template looks like.

    <!文档类型HTML>
    <HTML>
    <头部>
    <meta charset=“utf-8”/>
    <meta name=“viewport”content=“width=device width,initial scale=1.0”>
    <title>主页-我的ASP.NET应用程序</title>
    <link href=“https://fonts.googleapis.com/css”链接?族=lato“rel=”stylesheet“>
    <base href=“/”/>
    
    </head>
    <正文>
    <DIV class=“容器主体内容”>
    
    <DIV class=“col-md-12”>
    <app root>测试</app root>
    </DIV>
    </DIV>
    <hr/>
    <页脚>
    <P>复制;2018-美食</P>
    </footer>
    <link href=“/assets/bundles/styles.59e253c87b78feb8a0f7.bundle.css”rel=“stylesheet”/>
    
    <script src=“/assets/bundles/inline.318b50c57b4eba3d437b.bundle.js”></script>
    <script src=“/assets/bundles/polyfills.515ed9df1f4876ab6cb6.bundle.js”></script>
    

    </body>
    </html>
    

    这就是屏幕呈现的方式。

    我不知道动态占位符<div content-c0>generated by angular is taking with of 412px

    而如果您看到,我在父分区上有col-md-12this is caused layout issue.

    谢谢。

    </body>
    </html>
    

    这就是屏幕呈现的方式。

    enter image description here

    我不知道动态占位符<div _ngcontent-c0>由角产生,取412px

    如果你看到我col-md-12在父分区上,这导致布局问题。

    谢谢。

    2 回复  |  直到 6 年前
        1
  •  1
  •   bodorgergely    6 年前

    app.component.scss

    :host {
      width: 100%;
    }
    
        2
  •  1
  •   Senthil    6 年前