cannot get height 100% to work in polymer elements

后端 未结 1 400
盖世英雄少女心
盖世英雄少女心 2021-01-21 08:33

I\'m trying to use this technique

CSS 100% height layout

to fill page height 100%

Ultimately it fails because DOM has custom tags that won\'t honor h

相关标签:
1条回答
  • 2021-01-21 09:13

    By default, custom elements are display: inline. This means height:100% won't work unless you make the element block level:

    :host {
      display: block;
      height: 100%;
    }
    

    The other issue is your declaration. When you use extends to extend another element, this is called a type extension custom element. Instead of declaring <my-tag>, it needs to be declared using is="":

    <div is="my-tag"></div>
    

    Demo: http://jsbin.com/bohumisa/1/edit

    0 讨论(0)
提交回复
热议问题