Horizontal Layout in Polymer -
i building app using polymer. i've found layout system tricky. currently, i'm trying layout buttons this:
+----------------------------------------------------------------+ | [ok] [more info] [cancel] | +----------------------------------------------------------------+
the gap left of "ok" button 25% of entire width of page. remaining 75% used buttons. in attempt build above, put this plunk, includes following code:
<paper-toolbar class="statusbar"> <div style="width:25%;"></div> <div style="width:75%;" class="fit"> <div class="layout horizontal flex" style="padding-bottom:12px;"> <paper-button raised>ok</paper-button> <div class="flex"></div> <paper-button raised>more info</paper-button> <paper-button raised>cancel</paper-button> </div> </div> </paper-toolbar>
for reason, "25%" padding left isn't taken. don't understand why.
its recommended use border see trying build using div blocks. added margin:1px solid green
25%
, margin:1px solid yellow
75% div block , have far.
i changed code taking advantage of flexbox layout iron-flex-layout
here update plunkr
<paper-header-panel class="flex" mode="seamed"> <paper-toolbar> <div>hello</div> </paper-toolbar> <div class="fit content"> <div style="height:100%;"> hello world </div> </div> <paper-toolbar class="statusbar"> <div class="layout horizontal flex" style="width:100%"> <div class="layout vertical flex-1 center center" style="border:1px solid green"> <paper-button raised>ok</paper-button> </div> <div class="layout horizontal flex-4 " style="border:1px solid yellow"> <span class="flex"></span> <!-- take space--> <paper-button raised>more info</paper-button> <paper-button raised>cancel</paper-button> </div> </div> </paper-toolbar> </paper-header-panel>
Comments
Post a Comment