我要在这张卡的底部设置进度条。
我尝试 align-self: flex-end
和 margin-top: auto
失败。
实时示例:http://jsbin.com/zopaxep/edit?html,output
我该怎么做?
答案 0 :(得分:0)
这是您要寻找的东西吗?如果可以,我想这会起作用。
<!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>
希望,这就是您想要的。