{"id":26740,"date":"2023-03-23T10:49:52","date_gmt":"2023-03-23T03:49:52","guid":{"rendered":"https:\/\/www.caodangvietmy.edu.vn\/?p=26740"},"modified":"2023-04-05T13:57:44","modified_gmt":"2023-04-05T06:57:44","slug":"cach-tao-slider-voi-css-va-javascript","status":"publish","type":"post","link":"https:\/\/www.caodangvietmy.edu.vn\/en\/cach-tao-slider-voi-css-va-javascript\/","title":{"rendered":"How to Create a Slider with CSS and JavaScript"},"content":{"rendered":"<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><strong>Ng\u00f4n ng\u1eef Css v\u00e0 Javascript l\u00e0 ng\u00f4n ng\u1eef gi\u00fap ch\u00fang ta thi\u1ebft k\u1ebf page nh\u1eb9 nh\u00e0ng nh\u01b0ng \u0111\u1ea7y s\u1ef1 quy\u1ebfn r\u0169. V\u1edbi nh\u1eefng d\u1ea1ng slider nh\u01b0 th\u1ebf n\u00e0y th\u00ec vi\u1ec7c gi\u00fap ng\u01b0\u1eddi truy c\u1eadp v\u00e0o trang web s\u1ebd t\u1eadp trung h\u01a1n so v\u1edbi c\u00e1c giao di\u1ec7n kh\u00e1c.<\/strong><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">\u0110\u1ec3 t\u1ea1o slider, c\u00e1c b\u1ea1n theo d\u00f5i nh\u1eefng h\u01b0\u1edbng d\u1eabn d\u01b0\u1edbi \u0111\u00e2y.<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"1429\" height=\"750\" class=\"wp-image-26741 aligncenter\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26740-1.png\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26740-1.png 1429w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26740-1-640x336.png 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26740-1-1024x537.png 1024w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26740-1-768x403.png 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/word-image-26740-1-430x226.png 430w\" sizes=\"(max-width: 1429px) 100vw, 1429px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><strong>B\u01b0\u1edbc 1<\/strong>: T\u1ea1o c\u1ea5u tr\u00fac Website<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"264\" height=\"106\" class=\"wp-image-26742\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/graphical-user-interface-description-automaticall-3.png\" alt=\"Graphical user interface\n\nDescription automatically generated\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><strong>B\u01b0\u1edbc 2<\/strong>: D\u00f9ng c\u00f4ng c\u1ee5 thi\u1ebft k\u1ebf web b\u1ea5t k\u1ef3, v\u00ed d\u1ee5 nh\u01b0 visual studio code. Sau \u0111\u00f3 m\u1edf website MyAlbum \u0111\u1ec3 b\u1eaft \u0111\u1ea7u thi\u1ebft k\u1ebf<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"1980\" height=\"976\" class=\"wp-image-26743 aligncenter\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/a-picture-containing-icon-description-automatical.png\" alt=\"A picture containing icon\n\nDescription automatically generated\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/a-picture-containing-icon-description-automatical.png 1980w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/a-picture-containing-icon-description-automatical-640x315.png 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/a-picture-containing-icon-description-automatical-1024x505.png 1024w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/a-picture-containing-icon-description-automatical-768x379.png 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/a-picture-containing-icon-description-automatical-1536x757.png 1536w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/a-picture-containing-icon-description-automatical-430x212.png 430w\" sizes=\"(max-width: 1980px) 100vw, 1980px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><strong>B\u01b0\u1edbc 3<\/strong>: T\u1ea1o trang web c\u00f3 t\u00ean album.html c\u00f3 c\u1ea5u tr\u00fac nh\u01b0 sau:<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><img loading=\"lazy\" decoding=\"async\" width=\"1429\" height=\"702\" class=\"wp-image-26744 aligncenter\" src=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/graphical-user-interface-text-application-descr-1.png\" alt=\"Graphical user interface, text, application\n\nDescription automatically generated\" srcset=\"https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/graphical-user-interface-text-application-descr-1.png 1429w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/graphical-user-interface-text-application-descr-1-640x314.png 640w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/graphical-user-interface-text-application-descr-1-1024x503.png 1024w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/graphical-user-interface-text-application-descr-1-768x377.png 768w, https:\/\/www.caodangvietmy.edu.vn\/wp-content\/uploads\/2023\/03\/graphical-user-interface-text-application-descr-1-430x211.png 430w\" sizes=\"(max-width: 1429px) 100vw, 1429px\" \/><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><strong>B\u01b0\u1edbc 4:<\/strong> tr\u00ecnh b\u00e0y n\u1ed9i dung cho trang web, hi\u1ec3n th\u1ecb c\u00e1c h\u00ecnh \u1ea3nh l\u00ean web<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slider&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide slide-1&#8243;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-bg&#8221;&gt;&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-content&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-image&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;img src=&#8221;images\/VM1.jpeg&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-text&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;p&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Th\u1eadt Tuy\u1ec7t V\u1eddi!<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/p&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide slide-2&#8243;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-bg&#8221;&gt;&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-content&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-image&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><!-- &lt;img src=&#8221;https:\/\/i.ibb.co\/MkSbTjV\/juul-monster-0.jpg&#8221;&gt; --><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;img src=&#8221;images\/VM2.jpeg&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-text&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;p&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">H\u1ecdc C\u00f4ng Ngh\u1ec7 Th\u00f4ng Tin T\u1ea1i Vi\u1ec7t M\u1ef9 Th\u1eadt D\u1ec5<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/p&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide slide-3&#8243;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-bg&#8221;&gt;&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-content&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-image&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><!-- &lt;img src=&#8221;https:\/\/i.ibb.co\/FwnvDsz\/maxresdefault.jpg&#8221;&gt; --><\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;img src=&#8221;images\/VM3.jpeg&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slide-text&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;p&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">Okay Ch\u1ecdn C\u00f4ng Ngh\u1ec7 Th\u00f4ng Tin \u0110\u1ec3 Tho\u1ea3 \u0110am M\u00ea N\u00e0o!<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/p&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;div class=&#8221;slider-controls&#8221;&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;button type=&#8221;button&#8221; class=&#8221;btn-slide-previous&#8221; onclick=&#8221;previousSlide()&#8221;&gt;&amp;#10094&lt;\/button&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;button type=&#8221;button&#8221; class=&#8221;btn-slide-next&#8221; onclick=&#8221;nextSlide()&#8221;&gt;&amp;#10095&lt;\/button&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">&lt;\/div&gt;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><strong>B\u01b0\u1edbc 5:<\/strong> L\u00e0m \u0111\u1eb9p trang b\u1eb1ng css t\u1ea1i muc style<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">* {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">font-family: sans-serif;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">body {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">margin: 0;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slider {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">width: 100%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">height: 100vh;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">width: 100%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">height: 0;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">display: flex;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">visibility: hidden;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">overflow: hidden;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide.active {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">display: flex;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">height: 100%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">visibility: visible<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-bg {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">height: 100%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">clip-path: polygon(0 0, 0 90%, 150% 0%);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">z-index: 1;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">position: absolute;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">top: -100%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">width: 100%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide.active&gt;.slide-bg {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">top: 0;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-webkit-transition: all 1s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-moz-transition: all 1s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-ms-transition: all 1s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-o-transition: all 1s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">transition: all 1s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-image&gt;img {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">z-index: 2;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">opacity: 0;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide.active .slide-image&gt;img {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">opacity: 1;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-webkit-transition: opacity 2ss ease-in;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-moz-transition: opacity 2s ease-in;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-ms-transition: opacity 2s ease-in;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-o-transition: opacity 2s ease-in;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">transition: opacity 2s ease-in;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-image&gt;img {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">max-height: 100%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">max-width: 100%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">z-index: 1;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-content {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">max-width: 900px;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">max-height: 90%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">margin: auto;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">z-index: 2;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">position: relative;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">padding-left: 150px;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-image-bg {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">width: 0;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">height: 100%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">position: absolute;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">top: 0;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">z-index: 1<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide.active .slide-image-bg {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">width: 100%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-webkit-transition: all 1s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-moz-transition: all 1s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-ms-transition: all 1s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-o-transition: all 1s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">transition: all 1s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-text {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">background-color: #fff;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">padding: 1em 2em;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">position: absolute;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">top: 40%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">left: -100%;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">z-index: 3;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">width: 250px;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">box-shadow: 1px 1px 10px 0px rgba(0, 0, 0, 0.2);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">text-align: justify;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide.active .slide-text {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">left: 0;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-webkit-transition: all 2s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-moz-transition: all 2s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-ms-transition: all 2s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">-o-transition: all 2s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">transition: all 2s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-1 .slide-text {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">border-left: 10px solid darkslategray;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-1 .slide-bg {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">background-color: cadetblue;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-2 .slide-text {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">border-left: 10px solid burlywood;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-2 .slide-bg {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">background-color: antiquewhite;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-3 .slide-text {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">border-left: 10px solid darkslateblue;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slide-3 .slide-bg {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">background-color: deepskyblue;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.slider-controls {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">position: absolute;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">z-index: 5;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">bottom: 25px;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">right: 25px;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.btn-slide-next,<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.btn-slide-previous {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">cursor: pointer;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">width: 60px;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">height: 50px;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">color: #000;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">font-weight: bold;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">font-size: 20px;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">transition: 0.6s ease;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">user-select: none;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">background-color: #fff;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">border: 1px solid #000;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.btn-slide-previous:hover,<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">.btn-slide-next:hover {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">background-color: #000;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">border: 1px solid #fff;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">color: #fff;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><strong>B\u01b0\u1edbc 6:<\/strong> B\u01b0\u1edbc cu\u1ed1i c\u00f9ng s\u1eed d\u1ee5ng javascript l\u00e0m cho trang c\u00f3 s\u1ef1 t\u01b0\u01a1ng t\u00e1c v\u1edbi ng\u01b0\u1eddi d\u00f9ng \u2013 Ngh\u0129a l\u00e0 khi ng\u01b0\u1eddi d\u00f9ng click chu\u1ecdt v\u00e0o c\u00e1c n\u00fat m\u0169i t\u00ean th\u00ec h\u00ecnh s\u1ebd thay \u0111\u1ed5i<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">document.addEventListener(&#8220;DOMContentLoaded&#8221;, function() {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">setTimeout(function() {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">document.querySelector(&#8220;.slide&#8221;).classList.add(&#8220;active&#8221;);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}, 500)<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">});<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">function nextSlide() {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">let currSlide = document.querySelector(&#8220;.slide.active&#8221;),<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">nextSlide = currSlide.nextElementSibling;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">currSlide.classList.remove(&#8220;active&#8221;);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">if (nextSlide) {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">nextSlide.classList.add(&#8220;active&#8221;);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">} else {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">document.querySelectorAll(&#8220;.slide&#8221;)[0].classList.add(&#8220;active&#8221;);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">function previousSlide() {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">let currSlide = document.querySelector(&#8220;.slide.active&#8221;),<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">prevSlide = currSlide.previousElementSibling,<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">slideCount = document.querySelectorAll(&#8220;.slide&#8221;).length;<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">currSlide.classList.remove(&#8220;active&#8221;);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">if (prevSlide) {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">prevSlide.classList.add(&#8220;active&#8221;);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">} else {<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">document.querySelectorAll(&#8220;.slide&#8221;)[slideCount &#8211; 1].classList.add(&#8220;active&#8221;);<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\">}<\/span><\/p>\n<p style=\"text-align: justify;\"><span style=\"font-family: 'times new roman', times, serif;\"><strong>K\u1ebft Lu\u1eadn:<\/strong> Sau h\u01b0\u1edbng d\u1eabn tr\u00ean c\u00e1c b\u1ea1n \u0111\u00e3 t\u1ea1o ra \u0111\u01b0\u1ee3c m\u1ed9t album \u1ea3nh d\u01b0\u1edbi d\u1ea1ng slider th\u1eadt \u0111\u1eb9p. T\u1eeb \u0111\u00e2y, c\u00e1c b\u1ea1n s\u1ebd c\u00f3 th\u00eam nhi\u1ec1u s\u1ef1 l\u1ef1a ch\u1ecdn trong vi\u1ec7c \u0111i t\u00ecm nh\u1eefng \u00fd t\u01b0\u1edfng v\u1ec1 slider<\/span><\/p>\n<p style=\"text-align: justify;\">\n","protected":false},"excerpt":{"rendered":"<p>CSS and Javascript are languages that help us design pages that are both lightweight and captivating. Slider designs like these help visitors focus more on the website compared to other interfaces. To create a slider, follow these steps\u2026<\/p>","protected":false},"author":63,"featured_media":26741,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[33,877,851,626,850],"tags":[],"_links":{"self":[{"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/posts\/26740"}],"collection":[{"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/users\/63"}],"replies":[{"embeddable":true,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/comments?post=26740"}],"version-history":[{"count":0,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/posts\/26740\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/media\/26741"}],"wp:attachment":[{"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/media?parent=26740"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/categories?post=26740"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.caodangvietmy.edu.vn\/en\/wp-json\/wp\/v2\/tags?post=26740"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}