Tất cả bài viết  |  Bootstrap

  • zoom in
  • zoom out
  • text align left
  • text align center
  • text align right
  • Chỉnh màu chữ
  • Làm đậm

Cách tạo trang Slide quảng cáo đơn giản bằng Bootstrap

Trong bài học thiết kế website chuyên nghiệp này các Bạn sẽ được hướng dẫn Cách tạo trang Slide quảng cáo đơn giản bằng Bootstrap

Bước 1: Tạo cấu trúc HTML
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
<div class="container">
 <h1 class="text-center">Tạo trang Slide quảng cáo đơn giản bằng Bootstrap</h1>
 <div class="row">
  <div class="col-md-6 col-md-offset-3">
   <div id="myCarousel" class="carousel slide">
    <div class="carousel-inner">
     <div class="item active"> <a href="http://hocwebgiare.com/dao-tao-online/Chuyen-vien-website-lanh-nghe-online.html" target="_blank"><img class="thumbnail" src="http://hocwebgiare.com/thiet_ke_web_chuan_demo/slide_ads/images/hoc_thiet_ke_web_gia_re_online.png" alt="Khóa học Chuyên viên website lành nghề Online"></a>
     </div>
     <div class="item"> <a href="http://hocwebgiare.com/dao-tao-online/Lap-trinh-HTML5-CSS3-RWD-Javascript-Bootstrap-Online.html" target="_blank"><img class="thumbnail" src="http://hocwebgiare.com/thiet_ke_web_chuan_demo/slide_ads/images/hoc_bootstrap_online.png" alt="Khóa học Lập trình HTML5, CSS3, RWD, Javascript, Bootstrap Online"></a>
     </div>
     <div class="item"> <a href="http://hocwebgiare.com/dao-tao-online/Thiet-ke-giao-dien-website-online.html" target="_blank"><img class="thumbnail" src="http://hocwebgiare.com/thiet_ke_web_chuan_demo/slide_ads/images/thiet_ke_giao_dien_web.png" alt="Khóa học Thiết kế giao diện website Online"></a>
     </div>
     <div class="item"> <a href="http://hocwebgiare.com/dao-tao-online/Lap-trinh-PHP-Co-Ban-Online.html" target="_blank"><img class="thumbnail" src="http://hocwebgiare.com/thiet_ke_web_chuan_demo/slide_ads/images/php.png" alt="Khóa học Lập trình PHP Cơ Bản Online"></a>
     </div>
    </div>
    <div class="carousel-controls"> <a class="carousel-control left" href="http://hocwebgiare.com/cpadmin/form_blog.php?ID_blog=218#myCarousel" data-slide="prev"><span class="fa fa-angle-double-left"></span></a> <a class="carousel-control right" href="http://hocwebgiare.com/cpadmin/form_blog.php?ID_blog=218#myCarousel" data-slide="next"><span class="fa fa-angle-double-right"></span></a>
    </div>
   </div>
  </div>
 </div>
</div>
Bước 2: Định dạng CSS
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
body { 
padding-top: 0px;
}
.carousel-inner .item img {
width:100%;
height:100%;
}
.item .thumbnail { 
margin-bottom:0;
}
.carousel-control.left, .carousel-control.right {  
background-image:none !important;
}
.carousel-control {
background: #39b3d7;   
color:#fff;
padding: 0px 0;
width:26px;
top:auto;  
left:auto; 
bottom:8px;
opacity:0.4;   
text-shadow:none;
}
.carousel-control.right {  
right:10px;
}
.carousel-control.left {   
right: 40px;
}
Bước 3: Gọi thư viện Bootstrap
Bước 4: Gọi thư viện JQUERY
1
<script src="js/jquery-1.11.1.min.js"></script>
Bước 5: Tạo hiệu ứng Slide bằng JQUERY
1
2
3
$('#myCarousel').carousel({
interval:   4000
});
Xem  demo Tải Code Đăng ký tham gia làm hội viên của kênh để được xem các bài học mới nhất
Bạn có thể quan tâm

Tổng hợp các bài học hay về kỹ thuật thiết kế giao diện web với Fireworks Học lập trình web

Tổng hợp các bài học hay về lập trình hướng đối tượng PHP cơ bản Học lập trình web

Tổng hợp các bài học hay về lập trình bootstrap Học lập trình web

Hướng dẫn cách tạo Bootstrap ScrollSpy (Phần 2) Học lập trình web

Hướng dẫn cách tạo Bootstrap ScrollSpy (Phần 1) Học lập trình web

Hướng dẫn cách tạo Bootstrap Javascript Modal (Phần 2) Học lập trình web

Hướng dẫn cách tạo Bootstrap Javascript Modal (Phần 1) Học lập trình web

Hướng dẫn cách tạo Tooltip trong Bootstrap Học lập trình web

Hướng dẫn tạo Arcordion Panel trong Bootstrap (Phần 2) Học lập trình web

Hướng dẫn tạo Arcordion Panel trong Bootstrap (Phần 1) Học lập trình web