<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Progress Bar</title>
<style>
body {
font-family: Arial, sans-serif;
margin: 0;
padding: 0;
box-sizing: border-box;
background-color: #f0f2f5;
display: flex;
justify-content: center;
align-items: center;
height: 100vh;
}
.progress-container {
width: 100%;
max-width: 600px;
background-color: #ddd;
border-radius: 8px;
overflow: hidden;
}
.progress-bar {
height: 30px;
background-color: #007bff;
width: 0;
transition: width 0.5s;
color: white;
text-align: center;
line-height: 30px;
}
button {
margin-top: 20px;
padding: 10px 20px;
border: none;
border-radius: 5px;
background-color: #007bff;
color: white;
cursor: pointer;
font-size: 1em;
}
button:hover {
background-color: #0056b3;
}
</style>
</head>
<body>
<div class="progress-container">
<div id="progressBar" class="progress-bar">0%</div>
</div>
<button onclick="increaseProgress()">Increase Progress</button>
<script>
function increaseProgress() {
var progressBar = document.getElementById('progressBar');
var width = parseInt(progressBar.style.width) || 0;
if (width < 100) {
width += 10;
progressBar.style.width = width + '%';
progressBar.textContent = width + '%';
}
}
</script>
</body>
</html>
进度条效果
原创mb64cc5144d532c ©著作权
©著作权归作者所有:来自51CTO博客作者mb64cc5144d532c的原创作品,请联系作者获取转载授权,否则将追究法律责任
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章
-
控制台打印进度条
控制台打印进度条,实时展示任务进度。
进度条 System Java -
CSS 动态进度条效果
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ead><meta...
CSS 动态进度条效果 html css javascript -
粒子效果进度条
在线演示 本地下载
进度条 it技术 -
unity UGUI实现环形进度条 unity进度条效果
有时我们需要在Unity3D中绘制进度条,如: 或 如果使用4.6版本以下的unity绘制环形的进度条可能需要费点劲。我搜到的大多数方法都是用NGUI插件,但有时只是为了简单的画一个环
unity UGUI实现环形进度条 进度条 UI 半透明效果