我正在尝试创建一个带有进度条的标题,并使其具有响应性。我已经尝试阅读相关资料并尝试一些解决方案,但都未成功。因此,我的问题是:
- 如何使进度条随着屏幕的缩小而收缩?到目前为止,我已经使用表格来组织元素,并且可以将表格包装起来,但进度条本身不会收缩。
- 如何将进度条右对齐,以便在全屏时显示在右侧?
.header-style {
background-color: #2A417B;
height: auto;
width: auto;
display: block;
}
.header-text {
color: white;
margin: 0em;
text-align: left;
font-size: 1.5em;
}
.header-style-logo {
background-color: #2A417B;
display: block;
position: relative;
text-align: left;
padding: 1em;
}
.table-wrap {
display: block;
}
.table-wrap td {
display: inline-block;
}
progress {
display: inline-block;
width: 50em;
height: 2em;
margin: 1em;
/* IE settings */
color: #8FC23F;
background-color: white;
border: none;
}
/* Chrome settings */
progress::-webkit-progress-bar {
background: white;
}
progress::-webkit-progress-value {
background: #8FC23F;
}
/* Firefox settings */
progress::-moz-progress-bar {
background: white;
}
<header class="header-style">
<table class="table-wrap">
<tr>
<td><img class="header-style-logo" src="logo_white.png" width="111" height="72" /></td>
<td>
<h1 class="header-text"> My heading</h1>
</td>
<td> <progress value="5" max="100"></progress></td>
</tr>
</table>
</header>