代码之家  ›  专栏  ›  技术社区  ›  dman

在卡片底部设置进度条

  •  -1
  • dman  · 技术社区  · 7 年前

    我正在寻找设置在这张卡片底部的进度条。

    我试过了 align-self: flex-end margin-top: auto

    实例: http://jsbin.com/zopaxep/edit?html,output

    我该怎么做?

    1 回复  |  直到 7 年前
        1
  •  0
  •   chintuyadavsara    7 年前

    这就是你要找的吗?如果是的话,我想这会管用的。

    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width">
        <meta name="description" content="Polymer 2.0 Basic Legacy Element">
        <base href="//polygit2.appspot.com/webcomponentsjs+:v1/custom-elements+webcomponents+:master/shadydom+webcomponents+:master/shadycss+webcomponents+:master/polymer+:2.0-preview/components/">
        <script src="webcomponentsjs/webcomponents-lite.js"></script>
        <link rel="import" href="./polymer/polymer.html">
        <link rel="import" href="./paper-progress/paper-progress.html">
    
        <dom-module id="my-app">
          <template>
            <style>
    
           paper-progress {
            width: 100%;
            --paper-progress-height: 5px;
            }
    
          .header {
            align-items: center;
            display: flex;
          }
          .header-bar {
            padding: 0 25px;
            justify-content: space-between;
            width: 100%;
            display: block;
          }
    
          .header-transition {
            padding: 24px 0;
            display: flex;
            flex-flow: row wrap;
            justify-content: center;
            box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),
                        0 1px 5px 0 rgba(0, 0, 0, 0.12),
                        0 3px 1px -2px rgba(0, 0, 0, 0.2);
            margin: 5px 5px 0 5px;
          }
    
          .menu-adjustment {
            padding:20px;
            display: block;
            align-items: center;
          }
    
          .progress-container {
            margin-bottom: 0;
            align-self: flex-end;
            width: 100%;
          }
              
            </style>
         <div class="header-transition" id="mat" hiden$="[[opened]]">
    
          <div class="header-bar">
            <span class="header">Title</span>
    
            <div class="card-actions menu-adjustment">
              <div class="" id="headerContainer">
                <button>Submit</button>
              </div>
             
    
          </div>
    
          <div class="progress-container">
            <paper-progress indeterminate class="blue"></paper-progress>
          </div>
    
        </div>
    
        </template>
          <script>
            Polymer({
              is: 'my-app',
              properties: {
                preventLoad: {
                  type: Boolean,
                  value: false,
                },
              }
            });
          </script>
        </dom-module>
    
      </head>
      <body>
        <my-app></my-app>
      </body>
      </body>
    </html>

    编辑1

    将进度条放置在卡的底部

    <!DOCTYPE html>
    <html>
      <head>
        <meta charset="utf-8">
        <meta name="viewport" content="width=device-width">
        <meta name="description" content="Polymer 2.0 Basic Legacy Element">
        <base href="//polygit2.appspot.com/webcomponentsjs+:v1/custom-elements+webcomponents+:master/shadydom+webcomponents+:master/shadycss+webcomponents+:master/polymer+:2.0-preview/components/">
        <script src="webcomponentsjs/webcomponents-lite.js"></script>
        <link rel="import" href="./polymer/polymer.html">
        <link rel="import" href="./paper-progress/paper-progress.html">
    
        <dom-module id="my-app">
          <template>
            <style>
    
           paper-progress {
            width: 100%;
            --paper-progress-height: 5px;
            }
    
          .header {
            align-items: center;
            display: flex;
          }
          .header-bar {
            padding: 0 25px;
            justify-content: space-between;
            width: 100%;
            display: block;
          }
    
          .header-transition {
            padding: 24px 0;
            
            box-shadow: 0 2px 2px 0 rgba(0, 0, 0, 0.14),
                        0 1px 5px 0 rgba(0, 0, 0, 0.12),
                        0 3px 1px -2px rgba(0, 0, 0, 0.2);
            margin: 5px 5px 0 5px;
          }
    
          .menu-adjustment {
            
            display: block;
            align-items: center;
          }
    
          .progress-container {
            position:relative;
            bottom:0px;
            width: 100%;
          }
          .footer{
            position:relative;
            bottom:-23px;
            width:inherit;
            left:-25px;
            background-color:transparent;
          }
              
            </style>
            <div class="header-transition" id="mat" hiden$="[[opened]]">
    
              <div class="header-bar">
                <span class="header">Title</span>
    
                <div class="card-actions menu-adjustment">
                  <div class="" id="headerContainer">
                    <button>Submit</button>
                  </div>
    
    
                </div>
    
                <div class="footer">
                  
                   <div class="progress-container">
                          <paper-progress indeterminate class="blue"></paper-progress
                   </div>
                </div>
              </div>
    
            </div>
    
        </template>
          <script>
            Polymer({
              is: 'my-app',
              properties: {
                preventLoad: {
                  type: Boolean,
                  value: false,
                },
              }
            });
          </script>
        </dom-module>
    
      </head>
      <body>
        <my-app></my-app>
      </body>
      </body>
    </html>

    希望,这就是你要找的。

    推荐文章