Bùi Tấn Lực
- 25
- 30/09/2025
Thẻ progress trong HTML dùng để kiểm tra các tiến trình tải file, upload file hoặc quá trình hoàn thành biểu mẫu, chi tiết như nào hãy cùng chúng tôi phân tích:
Thẻ progress trong HTML
Chức năng của Thẻ progress trong HTML
Thẻ progress trong HTML dùng để kiểm tra các tiến trình tải file, upload file hoặc quá trình hoàn thành biểu mẫu, nó truyền vào 2 giá trị: value (tiến trình hiện tại) và max (giá trị khi hoàn thành).
Code Thẻ progress trong HTML
Thẻ progress mặc định trong HTML
<label for="file">Đang tải tiến trình:</label>
<progress id="file" value="31" max="100"> 31% </progress><br>
<label for="file">Đang tải tiến trình:</label>
<progress id="file" value="70" max="100"> 70% </progress>
Thẻ progress hình tròn trong HTML
<!DOCTYPE html>
<html>
<head>
<title>Thẻ progress hình tròn trong HTML</title>
<style>
@property --progress-value {
syntax: '<integer>';
inherits: false;
initial-value: 0;
}
@keyframes html-progress {
to { --progress-value: 92; }
}
@keyframes css-progress {
to { --progress-value: 87; }
}
@keyframes js-progress {
to { --progress-value: 73; }
}
.progress-bar {
width: 100px;
height: 100px;
border-radius: 50%;
/* to center the percentage value */
display: flex;
justify-content: center;
align-items: center;
}
.progress-bar::before {
counter-reset: percentage var(--progress-value);
content: counter(percentage) '%';
}
.html {
background:
radial-gradient(closest-side, white 79%, transparent 80% 100%),
conic-gradient(hotpink calc(var(--progress-value) * 1%), pink 0);
animation: html-progress 2s 1 forwards;
}
.html::before {
animation: html-progress 2s 1 forwards;
}
.css {
background:
radial-gradient(closest-side, white 79%, transparent 80% 100%, white 0),
conic-gradient(hotpink calc(var(--progress-value) * 1%), pink 0);
animation: css-progress 2s 1 forwards;
}
.css::before {
animation: css-progress 2s 1 forwards;
}
.js {
background:
radial-gradient(closest-side, white 79%, transparent 80% 100%, white 0),
conic-gradient(hotpink calc(var(--progress-value) * 1%), pink 0);
animation: js-progress 2s 1 forwards;
}
.js::before {
animation: js-progress 2s 1 forwards;
}
body {
font-family: -apple-system, system-ui, Helvetica, Arial, sans-serif;
margin: 30px auto;
display: flex;
justify-content: space-around;
align-items: center;
flex-wrap: wrap;
max-width: 600px;
}
h2 {
text-align: center;
}
progress {
visibility: hidden;
width: 0;
height: 0;
}
</style>
</head>
<body>
<h1>Thẻ progress mặc định trong HTML</h1>
<div class="progress-bar-container">
<h2>
<label for="html">HTML</label>
</h2>
<div class="progress-bar html">
<progress id="html" min="0" max="100" value="92"></progress>
</div>
</div>
<div class="progress-bar-container">
<h2>
<label for="css">CSS</label>
</h2>
<div class="progress-bar css">
<progress id="css" min="0" max="100" value="87"></progress>
</div>
</div>
<div class="progress-bar-container">
<h2>
<label for="js">JavaScript</label>
</h2>
<div class="progress-bar js">
<progress id="js" min="0" max="100" value="73"></progress>
</div>
</div>
</body>
</html>
Lời kết
Cảm ơn các bạn đã tham khảo bài viết Thẻ progress trong HTML.
- 0 Bình luận

Bùi Tấn Lực
CEO Bùi Tấn Lực người sáng lập ra Web Mới, là một lập trình viên website, người viết content, chuyên tư vấn các vấn đề về website và SEO website
Chia sẻ nội dung đánh giá của bạn về Thẻ progress trong HTML
Email, Điện thoại của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *
Email, Điện thoại của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *
Bình luận, Hỏi đáp
Đăng ký tư vấn miễn phí
Tìm hiểu 1 năm không bằng lắng nghe 1 câu tư vấn