<!DOCTYPE html>
    <html lang="vi" xmlns="http://www.w3.org/1999/xhtml" prefix="og: http://ogp.me/ns#">
    <head>
<title>Hiệu ứng chuyển động Animation trong CSS</title>
<meta name="description" content="Hiệu ứng chuyển động Animation trong CSS - Savefile - Tin Tức -...">
<meta name="author" content=".: Nguoicodonvn2008.info - Cõi lòng người cô đơn :.">
<meta name="copyright" content=".: Nguoicodonvn2008.info - Cõi lòng người cô đơn :. [admin@nguoicodonvn2008.info]">
<meta name="robots" content="index, archive, follow, noodp">
<meta name="googlebot" content="index,archive,follow,noodp">
<meta name="msnbot" content="all,index,follow">
<meta name="generator" content="NukeViet v4.5">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta property="og:title" content="Hiệu ứng chuyển động Animation trong CSS">
<meta property="og:type" content="website">
<meta property="og:description" content="Savefile - Tin Tức - https&#x3A;&#x002F;&#x002F;www.nguoicodonvn2008.info&#x002F;vi&#x002F;news&#x002F;savefile&#x002F;kien-thuc-may-tinh&#x002F;hieu-ung-chuyen-dong-animation-trong-css-10360.html">
<meta property="og:site_name" content=".&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.">
<meta property="og:url" content="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/hieu-ung-chuyen-dong-animation-trong-css-10360.html">
<link rel="shortcut icon" href="https://nguoicodonvn2008.info/favicon.ico">
<link rel="canonical" href="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/hieu-ung-chuyen-dong-animation-trong-css-10360.html">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/" title="Tin Tức" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/karaoke-dual/" title="Tin Tức - Karaoke Dual" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/nhac-tre/" title="Tin Tức - Nhạc trẻ" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tru-tinh/" title="Tin Tức - Trữ tình" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/nuoc-ngoai/" title="Tin Tức - Nước ngoài" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/remix/" title="Tin Tức - Remix" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tam-su-tinh-yeu/" title="Tin Tức - Tâm sự tình yêu" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tho-suu-tam/" title="Tin Tức - Thơ sưu tầm" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/cuoc-song/" title="Tin Tức - Cuộc sống" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/phan-mem/" title="Tin Tức - Phần mềm" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/kien-thuc-may-tinh/" title="Tin Tức - Kiến thức máy tính" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/hoc-tap/" title="Tin Tức - Học tập" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/tai-lieu/" title="Tin Tức - Tài liệu" type="application/rss+xml">
<link rel="alternate" href="https://nguoicodonvn2008.info/vi/news/rss/de-thi/" title="Tin Tức - Đề thi" type="application/rss+xml">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/assets/css/font-awesome.min.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/bootstrap.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/style.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/style.non-responsive.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/news.css" type="text/css">
<link rel="preload" as="style" href="https://nguoicodonvn2008.info/themes/default/css/custom.css" type="text/css">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/jquery/jquery.min.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/language/vi.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/DOMPurify/purify3.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/global.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/assets/js/site.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/news.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/main.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/custom.js" type="text/javascript">
<link rel="preload" as="script" href="https://nguoicodonvn2008.info/themes/default/js/bootstrap.min.js" type="text/javascript">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/assets/css/font-awesome.min.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/bootstrap.non-responsive.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/style.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/style.non-responsive.css">
<link rel="StyleSheet" href="https://nguoicodonvn2008.info/themes/default/css/news.css">
<link rel="stylesheet" href="https://nguoicodonvn2008.info/themes/default/css/custom.css">
<style type="text/css">
	body{background: #fff;}
</style>
    </head>
    <body>
<div id="print">
	<div id="hd_print">
		<h2 class="pull-left">.&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.</h2>
		<p class="pull-right"><a title=".&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;." href="https://nguoicodonvn2008.info/">https://nguoicodonvn2008.info</a></p>
	</div>
	<div class="clear"></div>
	<hr />
	<div id="content">
		<h1>Hiệu ứng chuyển động Animation trong CSS</h1>
		<ul class="list-inline">
			<li>Thứ hai - 12/05/2025 22:55</li>
			<li class="hidden-print txtrequired"><em class="fa fa-print">&nbsp;</em><a title="In ra" href="javascript:;" onclick="window.print()">In ra</a></li>
			<li class="hidden-print txtrequired"><em class="fa fa-power-off">&nbsp;</em><a title="Đóng cửa sổ này" href="javascript:;" onclick="window.close()">Đóng cửa sổ này</a></li>
		</ul>
		<div class="clear"></div>
		<div id="hometext">
		</div>
				<div class="imghome">
			<img alt="Hiệu ứng chuyển động Animation trong CSS" src="https://st.quantrimang.com/photos/image/2023/05/12/mau-hoat-anh-css.gif" width="460" class="img-thumbnail" />
		</div>
		<div class="clear"></div>
		<div id="bodytext" class="clearfix">
			<p style="text-align: justify;"><strong>Animation trong CSS</strong>&nbsp;cực kỳ cần thiết trong thiết kế web. Bài viết sẽ hướng dẫn bạn&nbsp;<strong>code hiệu ứng cho web từ animation CSS</strong>.<br />
<br />
CSS là viết tắt của Cascading Style Sheet, được sử dụng để thiết kế một trang web. HTML tạo nên cấu trúc trang web, nhưng CSS là thứ được sử dụng để tạo nên thiết kế đó. Ở bài viết này, bạn sẽ học được những kiến thức cơ bản để ứng dụng Animation của CSS vào thực tế.</p>

<div style="text-align: justify;">&nbsp;</div>

<h2 style="text-align: justify;">&nbsp;</h2>

<p style="text-align: justify;"><img alt="" data-i="0" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-1.gif" data-was-processed="true" height="182" src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-1.gif" width="616" /></p>

<h2 id="mcetoc_1ijq4idto42" style="text-align: justify;">CSS Animation là gì?</h2>

<p style="text-align: justify;">Hoạt ảnh CSS hay Animation là một cách tạo hiệu ứng hoạt ảnh trực quan bằng ngôn ngữ Cascading Style Sheets (CSS). Chúng cho phép bạn tạo hình ảnh động các thuộc tính của một phần tử, chẳng hạn như kích thước, màu sắc hoặc vị trí của nó, trong một khoảng thời gian xác định.</p>

<h3 id="mcetoc_1ijq4meor6d" style="text-align: justify;">Cấu hình một Animation</h3>

<div style="text-align: justify;">&nbsp;</div>

<p style="text-align: justify;">Để cấu hình hoạt ảnh, hãy làm theo các bước sau:</p>

<div style="text-align: justify;">Phần mềm quản lý</div>

<ol>
	<li style="text-align: justify;">Đầu tiên, hãy mở phần mềm hoạt ảnh bạn đang sử dụng.</li>
	<li style="text-align: justify;">Tiếp theo, hãy tạo một dự án mới hoặc mở một dự án hiện có.</li>
	<li style="text-align: justify;">Chọn đối tượng hoặc nhân vật mà bạn muốn tạo hoạt ảnh.</li>
	<li style="text-align: justify;">Đặt mốc thời gian cho hoạt ảnh bằng cách xác định độ dài và số khung hình.</li>
	<li style="text-align: justify;">Chọn loại hoạt ảnh bạn muốn tạo, chẳng hạn như khung hình chính hoặc đồ họa chuyển động.</li>
</ol>

<p style="text-align: justify;">Để tạo một chuyển động Animation, bạn cần phải có các&nbsp;<strong>keyframe.</strong>&nbsp;Mỗi keyframe sẽ được chạy ở một thời điểm xác định và trong keyframe đó nó quy định việc phần tử sẽ di chuyển ra sao.</p>

<p style="text-align: justify;">Ngoài ra, Animation còn gồm một số thuộc tính quy định các chi tiết khá quan trọng của hiệu ứng thường đi kèm như:</p>

<ul>
	<li style="text-align: justify;"><em>Thuộc tính animation-name</em></li>
	<li style="text-align: justify;"><em>Thuộc tính animation-duration</em></li>
	<li style="text-align: justify;"><em>Thuộc tính animation-timing-function</em></li>
	<li style="text-align: justify;"><em>Thuộc tính animation-delay</em></li>
	<li style="text-align: justify;"><em>Thuộc tính animation-iteration-count</em></li>
	<li style="text-align: justify;"><em>Thuộc tính aniamtion-direction</em></li>
	<li style="text-align: justify;"><em>Thuộc tính animation-fill-mode</em></li>
</ul>

<p style="text-align: justify;">Cùng Quantrimang.com tìm hiểu kỹ hơn về keyframe và các thuộc tính cần thiết trong nội dung tiếp theo.</p>

<h2 id="mcetoc_1ijq4idto43" style="text-align: justify;">Quy tắc Keyframe</h2>

<p style="text-align: justify;">Bên trong quy tắc này, bạn xác định các&nbsp;<strong>keyframe</strong>&nbsp;để quy định việc phần tử sẽ chuyển động ra sao tại mỗi thời điểm nhất định.</p>

<p style="text-align: justify;">Cú pháp của keyframe:</p>

<pre id="pre0" style="text-align: justify;">
@keyframes Name {   /*code*/}</pre>

<ul>
	<li style="text-align: justify;"><em>Name:</em>&nbsp;tên của animation bạn muốn tạo.</li>
	<li style="text-align: justify;"><em>code:</em>&nbsp;Các đoạn code quy định tiến trình chuyển động. Có 2 dạng:
	<ul>
		<li>Sử dụng phần trăm từ<strong>&nbsp;0% đến 100%.</strong></li>
		<li><strong>from...to:</strong>&nbsp;thiết lập giá trị từ khởi đầu (from - tương đương với 0%) đến kết thúc (to - tương đương với 100%).</li>
	</ul>
	</li>
</ul>

<p style="text-align: justify;">Để chuyển động xảy ra cần phải kết nối&nbsp;<strong>@keyframes</strong>&nbsp;với phần tử.</p>

<p style="text-align: justify;"><strong>Bảng tóm tắt các hiệu ứng animation trong CSS cần biết:</strong></p>

<table cellpadding="1" cellspacing="1">
	<tbody>
		<tr>
			<td width="160">
			<p style="text-align: justify;"><strong>Thuộc tính</strong></p>
			</td>
			<td>
			<p style="text-align: justify;"><strong>Mô tả</strong></p>
			</td>
		</tr>
		<tr>
			<td>
			<p style="text-align: justify;"><a>@keyframes</a></p>
			</td>
			<td>
			<p style="text-align: justify;">Chỉ định code animation</p>
			</td>
		</tr>
		<tr>
			<td>
			<p style="text-align: justify;"><a>animation</a></p>
			</td>
			<td>
			<p style="text-align: justify;">Một thuộc tính tốc ký để thiết lập tất cả các thuộc tính hoạt hình</p>
			</td>
		</tr>
		<tr>
			<td>
			<p style="text-align: justify;"><a>animation-delay</a></p>
			</td>
			<td>
			<p style="text-align: justify;">Chỉ định trì hoãn bắt đầu animation</p>
			</td>
		</tr>
		<tr>
			<td>
			<p style="text-align: justify;"><a>animation-direction</a></p>
			</td>
			<td>
			<p style="text-align: justify;">Chỉ định xem hoạt ảnh sẽ được phát tiến, lùi hay theo chu kỳ thay thế</p>
			</td>
		</tr>
		<tr>
			<td>
			<p style="text-align: justify;"><a>animation-duration</a></p>
			</td>
			<td>
			<p style="text-align: justify;">Chỉ định thời gian một hoạt ảnh sẽ hoàn thành một chu kỳ</p>
			</td>
		</tr>
		<tr>
			<td>
			<p style="text-align: justify;"><a>animation-fill-mode</a></p>
			</td>
			<td>
			<p style="text-align: justify;">Chỉ định kiểu cho thành phần khi hoạt ảnh không phát (trước khi bắt đầu, sau khi kết thúc hoặc cả hai)</p>
			</td>
		</tr>
		<tr>
			<td>
			<p style="text-align: justify;"><a>animation-iteration-count</a></p>
			</td>
			<td>
			<p style="text-align: justify;">Chỉ định số lần hoạt ảnh sẽ được phát</p>
			</td>
		</tr>
		<tr>
			<td>
			<p style="text-align: justify;"><a>animation-name</a></p>
			</td>
			<td>
			<p style="text-align: justify;">Chỉ định tên của hoạt ảnh @keyframe</p>
			</td>
		</tr>
		<tr>
			<td>
			<p style="text-align: justify;"><a>animation-play-state</a></p>
			</td>
			<td>
			<p style="text-align: justify;">Chỉ định hoạt ảnh đang chạy hoặc tạm dừng</p>
			</td>
		</tr>
		<tr>
			<td>
			<p style="text-align: justify;"><a>animation-timing-function</a></p>
			</td>
			<td>
			<p style="text-align: justify;">Chỉ định đường cong tốc độ của hoạt ảnh</p>
			</td>
		</tr>
	</tbody>
</table>

<div style="text-align: justify;">&nbsp;</div>

<p style="text-align: justify;"><strong>Ví dụ 1:</strong>&nbsp;Thay đổi màu nền background,&nbsp;<strong>sử dụng cú pháp from...to:</strong></p>

<pre id="pre1" style="text-align: justify;">
/* Code animation */@keyframes example {  from {background-color: pink;}  to {background-color: purple;}}/* Áp dụng animation vào phần tử */div {  width: 100px;  height: 100px;  background-color: purple;  animation-name: example;  animation-duration: 4s;}</pre>

<p style="text-align: justify;"><img alt="" data-i="1" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-2.gif" data-was-processed="true" height="105" src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-2.gif" width="124" /></p>

<p style="text-align: justify;"><strong>Ví dụ 2:</strong>&nbsp;Thay đổi màu nền background,&nbsp;<strong>sử dụng cú pháp %:</strong></p>

<pre id="pre2" style="text-align: justify;">
/* Code animation */@keyframes example {  0% {background-color: crimson;}  25% {background-color: lightsalmon;}  50% {background-color: pink;}  100% {background-color: indigo;}}/* Áp dụng animation vào phần tử */div {  width: 100px;  height: 100px;  background-color: crimson;  animation-name: example;  animation-duration: 4s;}</pre>

<p style="text-align: justify;"><img alt="" data-i="2" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-3.gif" data-was-processed="true" height="105" src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-3.gif" width="164" /></p>

<p style="text-align: justify;">Code đầy đủ:</p>

<pre id="pre3" style="text-align: justify;">
&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;style&gt;div {  width: 100px;  height: 100px;  background-color: Crimson;  -webkit-animation-name: example; /* Safari 4.0 - 8.0 */  -webkit-animation-duration: 4s; /* Safari 4.0 - 8.0 */  animation-name: example;  animation-duration: 4s;}/* Safari 4.0 - 8.0 */@-webkit-keyframes example {  0% {background-color: Crimson;}  25% {background-color: LightSalmon;}  50% {background-color: pink;}  100% {background-color: purple;}}/* Cú pháp tiêu chuẩn */@keyframes example {  0% {background-color: Crimson;}  25% {background-color: LightSalmon;}  50% {background-color: pink;}  100% {background-color: indigo;}}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</pre>

<p style="text-align: justify;"><strong>Ví dụ 3:</strong>&nbsp;Thay đổi cả màu nền và vị trí của phần tử &lt;div&gt; khi animation đạt 25%, 50% và 100%:</p>

<pre id="pre4" style="text-align: justify;">
/* Code animation */@keyframes example {  0% {background-color:red; left:0px; top:0px;}  25% {background-color:yellow; left:200px; top:0px;}  50% {background-color:blue; left:200px; top:200px;}  75% {background-color:green; left:0px; top:200px;}  100% {background-color:red; left:0px; top:0px;}}/* Áp dụng animation vào phần tử */div {  width: 100px;  height: 100px;  position: relative;  background-color: red;  animation-name: example;  animation-duration: 4s;}</pre>

<p style="text-align: justify;"><img alt="" data-i="3" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-4-1.gif" data-was-processed="true" height="206" src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-4-1.gif" width="206" /></p>

<div style="text-align: justify;">&nbsp;</div>

<p style="text-align: justify;">Code đầy đủ:</p>

<pre id="pre5" style="text-align: justify;">
&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;style&gt; div {  width: 100px;  height: 100px;  background-color: crimson;  position: relative;  -webkit-animation-name: example; /* Safari 4.0 - 8.0 */  -webkit-animation-duration: 4s; /* Safari 4.0 - 8.0 */  animation-name: example;  animation-duration: 4s;}/* Safari 4.0 - 8.0 */@-webkit-keyframes example {  0% {background-color:crimson; left:0px; top:0px;}  25% {background-color:lightsalmon; left:200px; top:0px;}  50% {background-color:seagreen; left:200px; top:200px;}  75% {background-color:midnightblue; left:0px; top:200px;}  100% {background-color:indigo; left:0px; top:0px;}}/* Cú pháp tiêu chuẩn */@keyframes example {  0% {background-color:crimson; left:0px; top:0px;}  25% {background-color:lightsalmon; left:200px; top:0px;}  50% {background-color:seagreen; left:200px; top:200px;}  75% {background-color:midnightblue; left:0px; top:200px;}  100% {background-color:indigo; left:0px; top:0px;}}&lt;/style&gt;&lt;/head&gt;&lt;div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</pre>

<p style="text-align: justify;"><strong>Lưu ý:</strong>&nbsp;Để tạo ra hiệu ứng Animation, bạn phải xác định ít nhất hai điều:</p>

<ul>
	<li style="text-align: justify;"><strong>Thuộc tính animation-duration</strong>&nbsp;là khoảng thời gian diễn ra hiệu ứng. Nếu phần duration không được chỉ định sẽ không xảy ra hiệu ứng vì giá trị mặc định bằng 0.</li>
	<li style="text-align: justify;"><strong>Thuộc tính animation-name&nbsp;</strong>xác định phần tử sẽ thực thi animation nào.</li>
</ul>

<h2 id="mcetoc_1ijq4idto44" style="text-align: justify;">Thuộc tính animation-delay</h2>

<p style="text-align: justify;"><strong>Thuộc tính animation-delay</strong>&nbsp;sử dụng để xác định khoảng thời gian trì hoãn giữa thời gian một thuộc tính thay đổi và lúc hiệu ứng animation thực sự bắt đầu.</p>

<p style="text-align: justify;"><strong>Ví dụ 1:</strong>&nbsp;Độ trễ 1 giây trước khi bắt đầu hiệu ứng.</p>

<pre id="pre6" style="text-align: justify;">
div {  width: 100px;  height: 100px;  position: relative;  background-color: red;  animation-name: example;  animation-duration: 4s;  animation-delay: 1s;}</pre>

<p style="text-align: justify;"><img alt="" data-i="4" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-5.gif" data-was-processed="true" height="206" src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-5.gif" width="206" /></p>

<p style="text-align: justify;">Code đầy đủ:</p>

<pre id="pre7" style="text-align: justify;">
&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;style&gt; div {  width: 100px;  height: 100px;  background-color: crimson;  position: relative;  -webkit-animation-name: example; /* Safari 4.0 - 8.0 */  -webkit-animation-duration: 4s; /* Safari 4.0 - 8.0 */  -webkit-animation-delay: 2s; /* Safari 4.0 - 8.0 */  animation-name: example;  animation-duration: 4s;  animation-delay: 1s;}/* Safari 4.0 - 8.0 */@-webkit-keyframes example {  0% {background-color:crimson; left:0px; top:0px;}  25% {background-color:lightsalmon; left:200px; top:0px;}  50% {background-color:seagreen; left:200px; top:200px;}  75% {background-color:midnightblue; left:0px; top:200px;}  100% {background-color:indigo; left:0px; top:0px;}}/* Standard syntax */@keyframes example {  0% {background-color:crimson; left:0px; top:0px;}  25% {background-color:lightsalmon; left:200px; top:0px;}  50% {background-color:seagreen; left:200px; top:200px;}  75% {background-color:midnightblue; left:0px; top:200px;}  100% {background-color:indigo; left:0px; top:0px;}}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</pre>

<p style="text-align: justify;">Animation-delay chấp nhận cả giá trị âm. Nếu sử dụng các giá trị âm, animation sẽ bắt đầu như kiểu phần tử đã phát trong N giây.</p>

<div style="text-align: justify;">&nbsp;</div>

<p style="text-align: justify;"><strong>Ví dụ 2:</strong>&nbsp;Animation sẽ bắt đầu như thể nó đã phát được 2 giây:</p>

<pre id="pre8" style="text-align: justify;">
div {  width: 100px;  height: 100px;  position: relative;  background-color: red;  animation-name: example;  animation-duration: 4s;  animation-delay: -2s;}</pre>

<p style="text-align: justify;"><img alt="" data-i="5" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-6.gif" data-was-processed="true" height="206" src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-6.gif" width="206" /></p>

<h2 id="mcetoc_1ijq4idto45" style="text-align: justify;">Thuộc tính animation-iteration-count</h2>

<p style="text-align: justify;"><strong>Thuộc tính animation-iteration-count</strong>&nbsp;sử dụng để thiết lập số lần thực hiện một animation. Giá trị thường là:</p>

<ul>
	<li style="text-align: justify;">Một số lần nhất định</li>
	<li style="text-align: justify;"><strong>infinite:</strong>&nbsp;animation lặp lại liên tục và vô hạn</li>
</ul>

<p style="text-align: justify;"><strong>Ví dụ 1:</strong>&nbsp;Animation chạy 3 lần và dừng lại</p>

<table>
	<tbody>
		<tr>
			<td>
			<pre id="pre9" style="text-align: justify;">
div {  width: 100px;  height: 100px;  position: relative;  background-color: red;  animation-name: example;  animation-duration: 4s;  animation-iteration-count: 3;}</pre>
			</td>
			<td style="text-align: justify;"><img alt="" data-i="6" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-7.gif" height="206" src="https://st.quantrimang.com/photos/image/holder.png" width="206" /></td>
		</tr>
	</tbody>
</table>

<p style="text-align: justify;"><strong>Ví dụ 2:</strong>&nbsp;Animation lặp lại liên tục và vô hạn</p>

<table>
	<tbody>
		<tr>
			<td>
			<pre id="pre10" style="text-align: justify;">
div {  width: 100px;  height: 100px;  position: relative;  background-color: red;  animation-name: example;  animation-duration: 4s;  animation-iteration-count: infinite;}</pre>
			</td>
			<td style="text-align: justify;"><img alt="" data-i="7" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-8.gif" height="206" src="https://st.quantrimang.com/photos/image/holder.png" width="206" /></td>
		</tr>
	</tbody>
</table>

<h2 id="mcetoc_1ijq4idto46" style="text-align: justify;">Thuộc tính animation-direction</h2>

<p style="text-align: justify;"><strong>Thuộc tính animation-direction</strong>&nbsp;sử dụng để xác định chiều chạy của animation. Các giá trị mà animation-direction có thể nhận là:</p>

<ul>
	<li style="text-align: justify;"><strong>normal:</strong>&nbsp;animation di chuyển bình thường tiến về phía trước (mặc định)</li>
	<li style="text-align: justify;"><strong>reverse:</strong>&nbsp;animation di chuyển theo hướng ngược lại, lui về sau.</li>
	<li style="text-align: justify;"><strong>alternate:</strong>&nbsp;animation di chuyển tiến về trước, sau đó lui theo hướng ngược lại</li>
	<li style="text-align: justify;"><strong>alternate-reverse:</strong>&nbsp;animation di chuyển ngược lại trước, rồi đổi chiều tiến về trước.</li>
</ul>

<p style="text-align: justify;"><strong>Ví dụ 1:</strong>&nbsp;Chạy animation theo hướng ngược lại</p>

<table>
	<tbody>
		<tr>
			<td>
			<pre id="pre11" style="text-align: justify;">
div {  width: 100px;  height: 100px;  position: relative;  background-color: crimson;  animation-name: example;  animation-duration: 4s;  animation-direction: reverse;}</pre>
			</td>
			<td style="text-align: justify;"><img alt="" data-i="8" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-9.gif" height="206" src="https://st.quantrimang.com/photos/image/holder.png" width="206" /></td>
		</tr>
	</tbody>
</table>

<p style="text-align: justify;"><strong>Ví dụ 2:</strong>&nbsp;Chạy animation với giá trị&nbsp;<em>alternate</em></p>

<table>
	<tbody>
		<tr>
			<td>
			<pre id="pre12" style="text-align: justify;">
div {  width: 100px;  height: 100px;  position: relative;  background-color: crimson;  animation-name: example;  animation-duration: 4s;  animation-iteration-count: 2;  animation-direction: alternate;}</pre>
			</td>
			<td style="text-align: justify;"><img alt="" data-i="9" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-10.gif" height="206" src="https://st.quantrimang.com/photos/image/holder.png" width="206" /></td>
		</tr>
	</tbody>
</table>

<p style="text-align: justify;"><strong>Ví dụ 3:</strong>&nbsp;Chạy animation với giá trị&nbsp;<em>alternate-reverse</em></p>

<table>
	<tbody>
		<tr>
			<td>
			<pre id="pre13" style="text-align: justify;">
div {  width: 100px;  height: 100px;  position: relative;  background-color: crimson;  animation-name: example;  animation-duration: 4s;  animation-iteration-count: 2;  animation-direction: alternate-reverse;}</pre>
			</td>
			<td style="text-align: justify;"><img alt="" data-i="10" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-11.gif" height="206" src="https://st.quantrimang.com/photos/image/holder.png" width="206" /></td>
		</tr>
	</tbody>
</table>

<p style="text-align: justify;">Code đầy đủ để bạn tham khảo:</p>

<pre id="pre14" style="text-align: justify;">
&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;style&gt; div {  width: 100px;  height: 100px;  background-color: crimson;  position: relative;  -webkit-animation-name: example; /* Safari 4.0 - 8.0 */  -webkit-animation-duration: 4s; /* Safari 4.0 - 8.0 */  -webkit-animation-direction: reverse; /* Safari 4.0 - 8.0 */  animation-name: example;  animation-duration: 4s;  animation-direction: alternate-reverse;   animation-iteration-count: 2;}/* Safari 4.0 - 8.0 */@-webkit-keyframes example {  0% {background-color:crimson; left:0px; top:0px;}  25% {background-color:lightsalmon; left:200px; top:0px;}  50% {background-color:seagreen; left:200px; top:200px;}  75% {background-color:midnightblue; left:0px; top:200px;}  100% {background-color:indigo; left:0px; top:0px;}}/* Standard syntax */@keyframes example {  0% {background-color:crimson; left:0px; top:0px;}  25% {background-color:lightsalmon; left:200px; top:0px;}  50% {background-color:seagreen; left:200px; top:200px;}  75% {background-color:midnightblue; left:0px; top:200px;}  100% {background-color:indigo; left:0px; top:0px;}}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;div&gt;&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</pre>

<div style="text-align: justify;">&nbsp;</div>

<h2 id="mcetoc_1ijq4idto47" style="text-align: justify;">Thuộc tính animation-timing-function</h2>

<p style="text-align: justify;"><strong>Thuộc tính animation-timing-function</strong>&nbsp;dùng để xác định tốc độ thay đổi khi hiệu ứng di chuyển.</p>

<p style="text-align: justify;">Các giá trị có sẵn như sau:</p>

<ul>
	<li style="text-align: justify;"><strong>ease:</strong>&nbsp;tạo hiệu ứng chuyển đổi khi bắt đầu thì chậm sau đó nhanh dần và gần kết thúc lại chậm dần (giá trị mặc định).</li>
	<li style="text-align: justify;"><strong>linear</strong>: tạo hiệu ứng chuyển đổi từ lúc bắt đầu với lúc kết thúc tốc độ là như nhau.</li>
	<li style="text-align: justify;"><strong>ease-in:</strong>&nbsp;tạo hiệu ứng chuyển đổi chậm lúc bắt đầu.</li>
	<li style="text-align: justify;"><strong>ease-out:</strong>&nbsp;tạo hiệu ứng chuyển đổi chậm lúc kết thúc.</li>
	<li style="text-align: justify;"><strong>ease-in-out:</strong>&nbsp;tạo hiệu ứng chuyển đổi chậm cả lúc bắt đầu và kết thúc.</li>
	<li style="text-align: justify;"><strong>cubic-bezier(n,n,n,n):</strong>&nbsp;cho phép bạn xác định một giá trị của riêng mình theo hàm bezier (Quantrimang.com sẽ giới thiệu ở một bài riêng sau nhé).</li>
</ul>

<pre id="pre15" style="text-align: justify;">
#div1 {animation-timing-function: linear;}#div2 {animation-timing-function: ease;}#div3 {animation-timing-function: ease-in;}#div4 {animation-timing-function: ease-out;}#div5 {animation-timing-function: ease-in-out;}</pre>

<p style="text-align: justify;"><img alt="" data-i="11" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-12.gif" data-was-processed="true" height="328" src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-12.gif" width="618" /></p>

<p style="text-align: justify;">Bạn tự chạy theo code sau để thấy rõ sự khác nhau nhé:</p>

<pre id="pre16" style="text-align: justify;">
&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;style&gt; body{background-color:#e9d8f4}div {  width: 100px;  height: 50px;  background-color: #58257b;  color:white;  font-family:arial;  position: relative;  -webkit-animation: mymove 5s infinite; /* Safari 4.0 - 8.0 */  animation: mymove 5s infinite;}/* Safari 4.0 - 8.0 */#div1 {-webkit-animation-timing-function: linear;}#div2 {-webkit-animation-timing-function: ease;}#div3 {-webkit-animation-timing-function: ease-in;}#div4 {-webkit-animation-timing-function: ease-out;}#div5 {-webkit-animation-timing-function: ease-in-out;}/* Cú pháp tiêu chuẩn */#div1 {animation-timing-function: linear;}#div2 {animation-timing-function: ease;}#div3 {animation-timing-function: ease-in;}#div4 {animation-timing-function: ease-out;}#div5 {animation-timing-function: ease-in-out;}/* Safari 4.0 - 8.0 */@-webkit-keyframes mymove {  from {left: 0px;}  to {left: 500px;}}/* Cú pháp tiêu chuẩn */@keyframes mymove {  from {left: 0px;}  to {left: 500px;}}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;div id=&quot;div1&quot;&gt;linear&lt;/div&gt;&lt;br&gt;&lt;div id=&quot;div2&quot;&gt;ease&lt;/div&gt;&lt;br&gt;&lt;div id=&quot;div3&quot;&gt;ease-in&lt;/div&gt;&lt;br&gt;&lt;div id=&quot;div4&quot;&gt;ease-out&lt;/div&gt;&lt;br&gt;&lt;div id=&quot;div5&quot;&gt;ease-in-out&lt;/div&gt;&lt;/body&gt;&lt;/html&gt;</pre>

<h2 id="mcetoc_1ijq4idto48" style="text-align: justify;">Thuộc tính animation-fill-mode</h2>

<p style="text-align: justify;">Animation CSS không gây ảnh hưởng đến phần tử trước khi chạy keyframe đầu tiên và sau khi keyframe cuối cùng kết thúc. Và&nbsp;<strong>thuộc tính animation-fill-mode</strong>&nbsp;sử dụng để thay đổi trạng thái của phần tử trước khi bắt đầu sau khi kết thúc Animation.</p>

<p style="text-align: justify;">Các giá trị có sẵn như sau:</p>

<ul>
	<li style="text-align: justify;"><strong>none:</strong>&nbsp;khi animation không hoạt động thì nó sẽ giữ nguyên trạng thái bất động của phần tử, không thêm một style nào vào thành phần (mặc định).</li>
	<li style="text-align: justify;"><strong>forwards</strong>: khi animation không hoạt động sau khi kết thúc animation, giá trị này sẽ apply các thuộc tính của lần cuối cùng xuất hiện trong keyframe vào trạng thái của phần tử (phụ thuộc vào animation-direction và animation-iteration-count).</li>
	<li style="text-align: justify;"><strong>backwards</strong>: khi animation không hoạt động trước khi bắt đầu animation (đang trong thời gian delay), giá trị này sẽ apply các thuộc tính của lần xuất hiện đầu tiên trong keyfame vào trạng thái của phần tử (phụ thuộc vào thuộc tính anmation-direction).</li>
	<li style="text-align: justify;"><strong>both:</strong>&nbsp;kết hợp cả forwards và backwards cho trạng thái phần tử.</li>
</ul>

<pre id="pre17" style="text-align: justify;">
#div1 {-webkit-animation-fill-mode: none;}#div2 {-webkit-animation-fill-mode: forwards;}#div3 {-webkit-animation-fill-mode: backwards;}#div4 {-webkit-animation-fill-mode: both;}</pre>

<p style="text-align: justify;"><img alt="" data-i="12" data-src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-15.gif" data-was-processed="true" height="462" src="https://st.quantrimang.com/photos/image/2019/05/08/hieu-ung-animation-15.gif" width="618" /></p>

<p style="text-align: justify;">Bạn thử tự demo để xem rõ sự khác biệt nhé, code đầy đủ đây:</p>

<pre id="pre18" style="text-align: justify;">
&lt;!DOCTYPE html&gt;&lt;html&gt;&lt;head&gt;&lt;style&gt; body{background-color: #e9d8f4}div {  width: 100px;  height: 100px;  background: pink;  font-family:arial;  position: relative;  -webkit-animation-name: example; /* Safari 4.0 - 8.0 */  -webkit-animation-duration: 3s; /* Safari 4.0 - 8.0 */   -webkit-animation-delay: 2s; /* Safari 4.0 - 8.0 */  animation-name: example;  animation-duration: 3s;   animation-delay: 2s;}/* Safari 4.0 - 8.0 */#div1 {-webkit-animation-fill-mode: none;}#div2 {-webkit-animation-fill-mode: forwards;}#div3 {-webkit-animation-fill-mode: backwards;}#div4 {-webkit-animation-fill-mode: both;}/* Cú pháp tiêu chuẩn */#div1 {-webkit-animation-fill-mode: none;}#div2 {-webkit-animation-fill-mode: forwards;}#div3 {-webkit-animation-fill-mode: backwards;}#div4 {-webkit-animation-fill-mode: both;}/* Safari 4.0 - 8.0 */@-webkit-keyframes example {  from {left: 0px; background-color: purple;}  to {left: 500px; background-color: pink;}}@keyframes example {  from {left: 0px; background-color: purple;}  to {left: 500px; background-color: pink;}}&lt;/style&gt;&lt;/head&gt;&lt;body&gt;&lt;div id=&quot;div1&quot;&gt;none&lt;/div&gt;&lt;br&gt;&lt;div id=&quot;div2&quot;&gt;forwards&lt;/div&gt;&lt;br&gt;&lt;div id=&quot;div3&quot;&gt;backwards&lt;/div&gt;&lt;br&gt;&lt;div id=&quot;div4&quot;&gt;both&lt;/div&gt;&lt;br&gt;&lt;/body&gt;&lt;/html&gt;</pre>

<div style="text-align: justify;">&nbsp;</div>

<h2 id="mcetoc_1ijq4idto49" style="text-align: justify;">Gộp chung các thuộc tính</h2>

<p style="text-align: justify;">Ta có một animation khai báo đầy đủ 6 thuộc tính như sau:</p>

<pre id="pre19" style="text-align: justify;">
div {  animation-name: example;  animation-duration: 5s;  animation-timing-function: linear;  animation-delay: 2s;  animation-iteration-count: infinite;  animation-direction: alternate;}</pre>

<p style="text-align: justify;">Tuy nhiên trong một vài trường hợp, việc khai đầy đủ như trên là không cần thiết và dài dòng. Vì vậy CSS hỗ trợ chúng ta một thuộc tính có thể khai báo toàn bộ giá trị của các thuộc tính trên, đó là thuộc tính&nbsp;<strong>animation.</strong></p>

<p style="text-align: justify;">Cú pháp sử dụng như sau (chú ý thứ tự khai báo):</p>

<pre id="pre20" style="text-align: justify;">
animation: name | duration | timing-function | delay | iteration-count | direction | fill-mode</pre>

<p style="text-align: justify;">Vậy ví dụ trên có thể được khai báo ngắn gọn trong 1 dòng như sau:</p>

<pre id="pre21" style="text-align: justify;">
div {  animation: example 5s linear 2s infinite alternate;}</pre>

<h2 id="mcetoc_1ijq4idto4a" style="text-align: justify;">Mẹo dùng animation CSS lập trình viên cần biết</h2>

<h3 id="mcetoc_1ijq4idto4b" style="text-align: justify;">Biến đổi một thành phần khi trỏ chuột</h3>

<p style="text-align: justify;">Một cách thiết kế phổ biến là có yếu tố mở rộng khi được tương tác. Ví dụ, bạn có thể dịch chuyển các nút bấm một chút lên phía trên khi ai đó trỏ chuột vào nó. Để làm việc đó, bạn chỉ cần thuộc tính transform.</p>

<h3 id="mcetoc_1ijq4idto4c" style="text-align: justify;">Khai báo nhiều keyframe bằng một khai báo</h3>

<p style="text-align: justify;">Mẫu phổ biến khác ở các animation trong css là lặp cùng một giá trị nhiều lần, có thể là màu sắc, kích thước hoặc hướng nào đó. Bạn có thể đạt được hiệu ứng keyframe CSS bằng cách khai bao nhiều keyframe với một khai báo.</p>

<h3 id="mcetoc_1ijq4idto4d" style="text-align: justify;">Dùng @property để tạo hiệu ứng thuộc tính tùy biến</h3>

<p style="text-align: justify;">Không phải tất cả thuộc tính trong CSS đều có thể tạo hiệu ứng động. Nếu muốn tạo hiệu ứng cho thành phần non-animatable, tốt nhất bạn nên dùng lệnh @property.</p>

<h3 id="mcetoc_1ijq4idto4e" style="text-align: justify;">Dùng prefers-reduced-motion để kích hoạt Preferences</h3>

<p style="text-align: justify;">Luôn nhớ rằng rất nhiều người không thích hiệu ứng dựa trên chuyển động. Thực tế, hầu hết người dùng đều có tùy chọn trong trình duyệt có thể tắt chuyển động để không bị sao nhãng. Bạn dễ dàng có thể kiểm soát vấn đề này bằng cách đóng gói hiệu ứng bên trong một truy vấn media no-preference.</p>

<h2 id="mcetoc_1ijq4idto4f" style="text-align: justify;">Ví dụ về hiệu ứng CSS sáng tạo</h2>

<p style="text-align: justify;"><strong>Mở phong bì thư</strong></p>

<p style="text-align: justify;">Đây là một trong số mẫu được nhiều người ưa thích. Hiệu ứng CSS thanh lịch này chăm chút tới từng chi tiết. Từ chuyển động đi xuống khi phong bì mở tới thông tin chi tiết trên giấy, tới đổ bóng bên dưới, rõ ràng những chi tiết nhỏ đã tạo nên một hiệu ứng nhất quán, mượt mà. Bạn có thể dùng nó làm nút bấm hoặc hiệu ứng cuộn màn hình.</p>

<pre id="pre22" style="text-align: justify;">
body {
	background: #323641;
}

.letter-image {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 200px;
	height: 200px;
	-webkit-transform: translate(-50%, -50%);
	-moz-transform: translate(-50%, -50%);
	transform: translate(-50%, -50%);
	cursor: pointer;
}

.animated-mail {
	position: absolute;
	height: 150px;
	width: 200px;
	-webkit-transition: .4s;
	-moz-transition: .4s;
	transition: .4s;
	.body {
		position: absolute;
		bottom: 0;
		width: 0;
		height: 0;
		border-style: solid;
		border-width: 0 0 100px 200px;
		border-color: transparent transparent #e95f55 transparent;
		z-index: 2;
	}
	.top-fold {
		position: absolute;
		top: 50px;
		width: 0;
		height: 0;
		border-style: solid;
		border-width: 50px 100px 0 100px;
		-webkit-transform-origin: 50% 0%;
		-webkit-transition: transform .4s .4s, z-index .2s .4s;
		-moz-transform-origin: 50% 0%;
		-moz-transition: transform .4s .4s, z-index .2s .4s;
		transform-origin: 50% 0%;
		transition: transform .4s .4s, z-index .2s .4s;
		border-color: #cf4a43 transparent transparent transparent;
		z-index: 2;
	}
	.back-fold {
		position: absolute;
		bottom: 0;
		width: 200px;
		height: 100px;
		background: #cf4a43;
		z-index: 0;
	}
	.left-fold {
		position: absolute;
		bottom: 0;
		width: 0;
		height: 0;
		border-style: solid;
		border-width: 50px 0 50px 100px;
		border-color: transparent transparent transparent #e15349;
		z-index: 2;
	}
	.letter {
		left: 20px;
		bottom: 0px;
		position: absolute;
		width: 160px;
		height: 60px;
		background: white;
		z-index: 1;
		overflow: hidden;
		-webkit-transition: .4s .2s;
		-moz-transition: .4s .2s;
		transition: .4s .2s;
		.letter-border {
			height: 10px;
			width: 100%;
      background: repeating-linear-gradient(
        -45deg,
        #cb5a5e,
        #cb5a5e 8px,
        transparent 8px,
        transparent 18px
      );
		}
		.letter-title {
			margin-top: 10px;
			margin-left: 5px;
			height: 10px;
			width: 40%;
			background: #cb5a5e;
		}
		.letter-context {
			margin-top: 10px;
			margin-left: 5px;
			height: 10px;
			width: 20%;
			background: #cb5a5e;
		}
		.letter-stamp {
			margin-top: 30px;
			margin-left: 120px;
			border-radius: 100%;
			height: 30px;
			width: 30px;
			background: #cb5a5e;
			opacity: 0.3;
		}
	}
}

.shadow {
	position: absolute;
	top: 200px;
	left: 50%;
	width: 400px;
	height: 30px;
	transition: .4s;
	transform: translateX(-50%);
	-webkit-transition: .4s;
	-webkit-transform: translateX(-50%);
	-moz-transition: .4s;
	-moz-transform: translateX(-50%);
	border-radius: 100%;
	background: radial-gradient(rgba(0,0,0,0.5), rgba(0,0,0,0.0), rgba(0,0,0,0.0));
}

	.letter-image:hover {
		.animated-mail {
			transform: translateY(50px);
			-webkit-transform: translateY(50px);
			-moz-transform: translateY(50px);
		}
		.animated-mail .top-fold {
			transition: transform .4s, z-index .2s;
			transform: rotateX(180deg);
			-webkit-transition: transform .4s, z-index .2s;
			-webkit-transform: rotateX(180deg);
			-moz-transition: transform .4s, z-index .2s;
			-moz-transform: rotateX(180deg);
			z-index: 0;
		}
		.animated-mail .letter {
			height: 180px;
		}
		.shadow {
			width: 250px;
		}
	}</pre>

<p style="text-align: justify;"><img alt="Mẫu CSS động dạng phong bì thư" data-i="13" data-src="https://st.quantrimang.com/photos/image/2023/05/12/mau-hoat-anh-css.gif" data-was-processed="true" height="330" src="https://st.quantrimang.com/photos/image/2023/05/12/mau-hoat-anh-css.gif" width="650" /></p>

<div style="text-align: justify;">&nbsp;</div>
		</div>
				<div id="author">
						<p>
				<strong>Nguồn tin:</strong>
				Quantrimang.com:
			</p>
		</div>
	</div>
	<div id="footer" class="clearfix">
		<div id="url">
			<strong>URL của bản tin này: </strong><a href="https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/hieu-ung-chuyen-dong-animation-trong-css-10360.html" title="Hiệu ứng chuyển động Animation trong CSS">https://www.nguoicodonvn2008.info/vi/news/savefile/kien-thuc-may-tinh/hieu-ung-chuyen-dong-animation-trong-css-10360.html</a>

		</div>
		<div class="clear"></div>
		<div class="copyright">
			&copy; .&#x3A; Nguoicodonvn2008.info - Cõi lòng người cô đơn &#x3A;.
		</div>
		<div id="contact">
			<a href="mailto:admin@nguoicodonvn2008.info">admin@nguoicodonvn2008.info</a>
		</div>
	</div>
</div>
        <div id="timeoutsess" class="chromeframe">
            Bạn đã không sử dụng Site, <a onclick="timeoutsesscancel();" href="https://nguoicodonvn2008.info/#">Bấm vào đây để duy trì trạng thái đăng nhập</a>. Thời gian chờ: <span id="secField"> 60 </span> giây
        </div>
        <div id="openidResult" class="nv-alert" style="display:none"></div>
        <div id="openidBt" data-result="" data-redirect=""></div>
		</script>
		<div class="car-top">
  <span><img src="https://nguoicodonvn2008.info/themes/default/images/car.png" alt=""></span>
</div>
<script src="https://nguoicodonvn2008.info/assets/js/jquery/jquery.min.js"></script>
<script>var nv_base_siteurl="/",nv_lang_data="vi",nv_lang_interface="vi",nv_name_variable="nv",nv_fc_variable="op",nv_lang_variable="language",nv_module_name="news",nv_func_name="savefile",nv_is_user=0, nv_my_ofs=-4,nv_my_abbr="EDT",nv_cookie_prefix="nv4c_e856T",nv_check_pass_mstime=1738000,nv_area_admin=0,nv_safemode=0,theme_responsive=0,nv_recaptcha_ver=2,nv_recaptcha_sitekey="",nv_recaptcha_type="image",XSSsanitize=1;</script>
<script src="https://nguoicodonvn2008.info/assets/js/language/vi.js"></script>
<script src="https://nguoicodonvn2008.info/assets/js/DOMPurify/purify3.js"></script>
<script src="https://nguoicodonvn2008.info/assets/js/global.js"></script>
<script src="https://nguoicodonvn2008.info/assets/js/site.js"></script>
<script src="https://nguoicodonvn2008.info/themes/default/js/news.js"></script>
<script src="https://nguoicodonvn2008.info/themes/default/js/main.js"></script>
<script src="https://nguoicodonvn2008.info/themes/default/js/custom.js"></script>
<script type="application/ld+json">
        {
            "@context": "https://schema.org",
            "@type": "Organization",
            "url": "https://nguoicodonvn2008.info",
            "logo": "https://nguoicodonvn2008.info/uploads/angel.gif"
        }
        </script>
<script src="https://nguoicodonvn2008.info/themes/default/js/bootstrap.min.js"></script>
<script type="text/javascript">
var $scrolltop = $('.car-top');
$scrolltop.on('click', function () {
    $('html,body').animate({
        scrollTop: 0
    }, 800);
    $(this).addClass("car-run");
    setTimeout(function(){ $scrolltop.removeClass('car-run');}, 1000);
    return false;
});
$(window).on('scroll', function ()
{ 
    if($(window).scrollTop() >= 200)
    {
        $scrolltop.addClass("show");
        $scrolltop.addClass("car-down");
    }
    else
    {
       $scrolltop.removeClass("show");
       setTimeout(function(){ $scrolltop.removeClass('car-down');}, 300);
    }
});
</script>
</body>
</html>