Hướng dẫn bootstrap hr class color - màu lớp bootstrap hr

Lightweight, flexible component for showcasing hero unit style content.

A lightweight, flexible component that can optionally extend the entire viewport to showcase key marketing messages on your site.

Hello, world!

This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.


It uses utility classes for typography and spacing to space content out within the larger container.

Learn more

 class="jumbotron">
   class="display-4">Hello, world!
   class="lead">This is a simple hero unit, a simple jumbotron-style component for calling extra attention to featured content or information.

class="my-4">

It uses utility classes for typography and spacing to space content out within the larger container.

class="lead"> class="btn btn-primary btn-lg" href="#" role="button">Learn more

To make the jumbotron full width, and without rounded corners, add the .jumbotron-fluid modifier class and add a .container or .container-fluid within.

Fluid jumbotron

This is a modified jumbotron that occupies the entire horizontal space of its parent.

 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

Mình tạo một thư mục tên là Hinh_Anh và trong đó đặt một file ảnh tên là Hinh_anh_1.jpg. Sau đó sử dụng thuộc tính

 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

7 để thiết lập ảnh nền cho thẻ div id
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

8. Dưới đây là File hình ảnh nếu bạn cần nhé: Download hình ảnh.

Framework Bootstrap 4

Phát triển giao diện bằng Bootstrap 4:

Để bạn nắm rõ hơn và thực hành những gì mình đã học thì chúng ta sẽ đi vào dự án thiết kế giao diện cho trang web công ty về dịch vụ bằng Bootstrap 4. Đầu tiên thì mình sẽ phát họa ra những phần của trang web giúp bạn có thể hiểu được cái sườn mà ta sẽ làm. Để hiểu rõ hơn bạn xem hình ảnh dưới đây nhé:

Sau khi đã xác định rõ bố cục thì mình sẽ đi vào tạo những file cần thiết cho việc thiết kế trang web là HTML, CSS, JS và Bootstrap. Để không mất thời gian của bạn thì mình đã tạo một thư mục chứa sắn các file cần thiết và để đường dẫn bên dưới để tải về nhé.

Đường dẫn tải File Source Code Dự Án Bootstrap 4

Mình có lưu ý nhỏ là ở trên mình sử dụng CDN link liên kết với file Bootstrap 4 để thiết lập nhanh hơn còn nếu bạn thích tải các file về để sử dụng thì có thể xem thêm ở đây nhé: Cách tải Bootstrap 4. Bạn cũng nên để các file Javascript nằm cuối cùng trang HTML để tối ưu hiệu suất trang web và nếu cần chỉnh sửa CSS thì bạn phải đặt file CSS của mình nằm bên dưới file CSS của Bootstrap nhé.

Bây giờ chúng ta sẽ đi vào cách tạo thanh điều hướng bằng cách sử dụng component navbar trong Bootstrap 4. Để nắm rõ hơn bạn xem đoạn code dưới đây nhé:

HTML:



  
    Niềm Vui Lập Trình
    
      
    
    
      
        
          Về Chúng Tôi
        
        
          Tiện Ích
        
        
          Giá Dịch Vụ
        
        
          Liên Hệ
        
      
    
  
  

Ở trên mình sử dụng thuộc tính

 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

0 trong thẻ div class
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

1 dùng để đẩy các phần tử trong navbar nằm sang bên phải và sử dụng class
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

2 để xác định màu nền cho component Navbar. Bạn có thể thay đổi màu tùy vào mục đích của mình bằng cách gọi
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

3 với color là các màu cơ bản trong Bootstrap như là primay, success... Để nắm rõ hơn bạn xem ví dụ sau đây nhé:

See the Pen Navabar Example Bootstrap 4 by haycuoilennao19 (@haycuoilennao19) on CodePen.

Để xem được kết quả bạn chuyển sang chế độ screen 0.5x, 0.25x nha. Bây giờ chúng ta sẽ đi vào thiết kế phần thứ hai cho trang web và để hiểu rõ hơn bạn xem đoạn code sau nhé:0.5x, 0.25x nha. Bây giờ chúng ta sẽ đi vào thiết kế phần thứ hai cho trang web và để hiểu rõ hơn bạn xem đoạn code sau nhé:

HTML:


  
    
      
        Niềm Vui Lập Trình
        Mang đến niềm vui cho các bạn học lập trình.
        

        
          
             Facebook
          
          
             Google
          
        
      
    
  
  

Ở trên mình sử dụng thuộc tính
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron

class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

0 trong thẻ div class
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

1 dùng để đẩy các phần tử trong navbar nằm sang bên phải và sử dụng class
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

2 để xác định màu nền cho component Navbar. Bạn có thể thay đổi màu tùy vào mục đích của mình bằng cách gọi
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

3 với color là các màu cơ bản trong Bootstrap như là primay, success... Để nắm rõ hơn bạn xem ví dụ sau đây nhé:
.container-fluid {
    padding: 0 !important;
}
section#header-gioi-thieu {
    background-image: url("Hinh_Anh/Hinh_anh_1.jpg");
    background-size: cover;
    height: 400px;
    background-position: center center;
}
section#header-gioi-thieu .wrap-headline {
    position: relative;
    padding-top: 5%;
}
section#header-gioi-thieu h2,
section#header-gioi-thieu h2 {
    color: #FFF;
}
section#header-gioi-thieu h2 {
    font-size: 1.5rem;
}

See the Pen Navabar Example Bootstrap 4 by haycuoilennao19 (@haycuoilennao19) on CodePen.

  • Để xem được kết quả bạn chuyển sang chế độ screen 0.5x, 0.25x nha. Bây giờ chúng ta sẽ đi vào thiết kế phần thứ hai cho trang web và để hiểu rõ hơn bạn xem đoạn code sau nhé:
  • CSS:
  • Ở trên đây mình có mộ vài lưu ý là :Hinh_Anh và trong đó đặt một file ảnh tên là Hinh_anh_1.jpg. Sau đó sử dụng thuộc tính
     class="jumbotron jumbotron-fluid">
       class="container">
         class="display-4">Fluid jumbotron
         class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

    7 để thiết lập ảnh nền cho thẻ div id
     class="jumbotron jumbotron-fluid">
       class="container">
         class="display-4">Fluid jumbotron
         class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

    8. Dưới đây là File hình ảnh nếu bạn cần nhé:
    Download hình ảnh.
  • Sử dụng flex và căn vị trí chính giữa cho nội dung bằng cách sử dụng class
     class="jumbotron jumbotron-fluid">
       class="container">
         class="display-4">Fluid jumbotron
         class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

    4 ,
     class="jumbotron jumbotron-fluid">
       class="container">
         class="display-4">Fluid jumbotron
         class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

    5,
     class="jumbotron jumbotron-fluid">
       class="container">
         class="display-4">Fluid jumbotron
         class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

    6. Nếu bạn muốn tìm hiểu thêm về flex trong Bootstrap có thể tham khảo ở đây nhé: Flex Bootstrap 4.

Mình sử dụng Font Awesome 4.7 để tạo các icon cho các nút. Bạn có thể tham khảo ở đây nhé: Cài đặt Font Awesome 4.7.

Hướng dẫn bootstrap hr class color - màu lớp bootstrap hr

Mình tạo một thư mục tên là Hinh_Anh và trong đó đặt một file ảnh tên là Hinh_anh_1.jpg. Sau đó sử dụng thuộc tính

 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

7 để thiết lập ảnh nền cho thẻ div id
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

8. Dưới đây là File hình ảnh nếu bạn cần nhé: Download hình ảnh.

Mình thiết lập thuộc tính

 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

9 cho class


  
    Niềm Vui Lập Trình
    
      
    
    
      
        
          Về Chúng Tôi
        
        
          Tiện Ích
        
        
          Giá Dịch Vụ
        
        
          Liên Hệ
        
      
    
  
  

0 để làm độ rộng của nó bằng với trang web.

Do Code pen không hiển thị được phần này nên bạn xem kết quả thông qua hình dưới đây nhé:

HTML:


  
    
      
        
Hướng dẫn bootstrap hr class color - màu lớp bootstrap hr

      
      
        

Tiêu Đề Máy Tính 1


        


          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec lobortis iaculis sodales. Etiam ante elit, commodo vitae enim vel, imperdiet aliquet lectus. Curabitur id consequat quam, vitae convallis lacus. Suspendisse potenti. Curabitur rhoncus vestibulum pulvinar. Nullam mauris ex, dapibus sed nisi sed, posuere pulvinar eros.
        


      
    
    

    
      
        

Tiêu Đề Máy Tính 2


        


          Lorem ipsum dolor sit amet, consectetur adipiscing elit. Donec lobortis iaculis sodales. Etiam ante elit, commodo vitae enim vel, imperdiet aliquet lectus. Curabitur id consequat quam, vitae convallis lacus. Suspendisse potenti. Curabitur rhoncus vestibulum pulvinar. Nullam mauris ex, dapibus sed nisi sed, posuere pulvinar eros.
        


      
      
        
Hướng dẫn bootstrap hr class color - màu lớp bootstrap hr

      
    
  

Ở trên mình sử dụng thuộc tính
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron

class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

0 trong thẻ div class
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

1 dùng để đẩy các phần tử trong navbar nằm sang bên phải và sử dụng class
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

2 để xác định màu nền cho component Navbar. Bạn có thể thay đổi màu tùy vào mục đích của mình bằng cách gọi
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

3 với color là các màu cơ bản trong Bootstrap như là primay, success... Để nắm rõ hơn bạn xem ví dụ sau đây nhé:
section#thong_tin_san_pham{
    margin-top:6rem;
}

See the Pen Navabar Example Bootstrap 4 by haycuoilennao19 (@haycuoilennao19) on CodePen.

Để xem được kết quả bạn chuyển sang chế độ screen 0.5x, 0.25x nha. Bây giờ chúng ta sẽ đi vào thiết kế phần thứ hai cho trang web và để hiểu rõ hơn bạn xem đoạn code sau nhé:

CSS:

Ở trên đây mình có mộ vài lưu ý là :

Sử dụng flex và căn vị trí chính giữa cho nội dung bằng cách sử dụng class
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron

class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

4 ,
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

5,
 class="jumbotron jumbotron-fluid">
   class="container">
     class="display-4">Fluid jumbotron
     class="lead">This is a modified jumbotron that occupies the entire horizontal space of its parent.

6. Nếu bạn muốn tìm hiểu thêm về flex trong Bootstrap có thể tham khảo ở đây nhé: Flex Bootstrap 4.

Mình sử dụng Font Awesome 4.7 để tạo các icon cho các nút. Bạn có thể tham khảo ở đây nhé: Cài đặt Font Awesome 4.7.