Tiêu đề bootstrap

Trong bài viết này, chúng ta sẽ cùng xem tổng quan về 2 hạng mục

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
4 nội dung và
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
5 dàn trang trong tài liệu của Bootstrap. Trước hết thì chúng ta sẽ nói về
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
4 bởi vì hiển thị các nội dung chi tiết là công việc quan trọng thứ 2 sau khi thiết lập các thành phần chính như thanh điều hướng hay slide ảnh. Rồi sau đó chúng ta mới có chất liệu để thực hiện dàn trang và canh chỉnh vị trí tạo ra bố cục hoàn chỉnh của một trang web

Hạng mục Nội dung

Tiêu đề bootstrap

Bán phát triển @thinhtranhnvn

Theo dõi

3. 9K 184 206

Đã đăng vào ngày 3 tháng 12 năm 2. 30 CH 8 phút đọc

1. 0K

0

1

[Bootstrap] Bài 3 - Nội dung và Bố cục

  • Report
  • Add to series of me

Trong bài viết này, chúng ta sẽ cùng xem tổng quan về 2 hạng mục

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
4 nội dung và
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
5 dàn trang trong tài liệu của Bootstrap. Trước hết thì chúng ta sẽ nói về
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
4 bởi vì hiển thị các nội dung chi tiết là công việc quan trọng thứ 2 sau khi thiết lập các thành phần chính như thanh điều hướng hay slide ảnh. Rồi sau đó chúng ta mới có chất liệu để thực hiện dàn trang và canh chỉnh vị trí tạo ra bố cục hoàn chỉnh của một trang web

Hạng mục Nội dung

Hạng mục Nội dung cung cấp các hạng tiện ích giúp tùy chỉnh cách hiển thị cho các loại nội dung phổ biến có mặt trong một trang web. Dễ thấy nhất là hạng mục

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
7 dành cho nội dung văn bản và
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
8 dành cho nội dung ảnh

Mặc dù Bootstrap có thiết lập sẵn có cách hiển thị cho các thẻ nội dung phổ biến như các thẻ tiêu đề

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
9, các thẻ văn bản

<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
0, v. v. Tuy nhiên, thông thường thì chúng ta sẽ muốn tùy biến kích thước chữ linh hoạt hơn theo thiết kế của từng trang web. Do đó Bootstrap cung cấp thêm các lớp tiện ích để đáp ứng cho tác vụ tùy chỉnh này. Ví dụ như bộ lớp

<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
1 với 6 tùy chọn cấp độ có thể giúp chúng tôi điều chỉnh kích thước chữ của bất kỳ cấp tiêu đề nào theo ý muốn

Hãy thử kiến ​​trúc phần tiếp theo của giao diện trang chủ với một tiêu đề chính, một câu mô tả rút gọn và một nút nhấn

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
1

Ở đây chúng ta sử dụng


<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
2 để tăng kích thước chữ cho tiêu đề và

<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
3 để tăng kích thước chữ cho văn bản mô tả ngắn. Các lớp tiện ích còn lại hầu hết đều có sẵn trong

<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
4. Ở phần này, chúng ta cần thêm một khoảng

<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
5 khá lớn ở phía trên và bên dưới nội dung chính để tạo ra một vùng đủ rộng để có thể hiển thị nền. Cấp độ ________ 95 theo chiều dọc lớn nhất của Bootstrap là

<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
7 dường như không trả lời được yêu cầu nên mình định nghĩa thêm

<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
8

Hình nền của khối được thiết lập thông qua


<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
9 để thuận tiện sử dụng lại ở bất kỳ phần nào khác nếu cần thiết

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}

Layout item

Dàn trang tác vụ được Bootstrap định nghĩa gói gọn trong 2 bước

  • Tạo vùng chứa chính để hiển thị tập tin nội dung trung giữa trang hoặc trải rộng toàn trang
  • Sử dụng lưới 12 cột để bố trí cục bộ cho các hàng nội dung

Gần như bất kỳ thành phần nào của trang web cũng đều có một phần tử

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
10 đóng bao trò bao quanh nội dung chính để cung cấp cho

<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
5 cơ bản giúp các nội dung không được hiển thị sát viền màn hình. Nhiều thiết kế web cũng cố gắng tạo vùng nội dung tập tin trung với chiều rộng không quá lớn để người đọc dễ theo dõi nội dung khi đọc xuống dòng. Do đó Bootstrap có cung cấp các
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
12 cho
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
10 để chúng ta thực hiện nhiệm vụ này

Kế đến là các nội dung trong trang web của chúng ta thường được hiển thị theo các hàng ngang. Do đó Bootstrap có nghĩa là

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
14 để tạo hàng hiển thị với các phần tử con
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
15 với tổng của
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
16 của mỗi hàng là cột
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
17. Trong trường hợp chúng ta không chỉ định
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
16 thì Bootstrap sẽ tự động chia đều các cột cho số phần tử con của hàng
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
14

Phương thức này đủ linh hoạt để giúp chúng ta thực hiện dàn trang cho hầu hết các thiết kế web. Ví dụ chúng ta có ở đây cũng chính là phần tiếp theo của giao diện trang chủ mà chúng ta đang xây dựng với 1 hàng nội dung bao gồm 3 cột cho phần

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
10 và 3 hàng nội dung với 2 cột cho phần
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
11


<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
1

Ở phần

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
10 bạn để ý thấy chúng ta có 3 phần tử con của hàng
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
14 không cần chỉ định số cột chiều rộng và Bootstrap đã tự động chia đều 12 cột chiều rộng cho 3 cột nội dung. Nếu như chúng ta sử dụng
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
14 thay cho
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
15 thì kết quả hiển thị thu vẫn sẽ tương tự

Ở phần tiếp theo

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
11 chúng ta chỉ định rõ
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
17 cho mỗi cột nội dung và còn lại 2 chiều rộng cột. Lúc này lớp
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
18 được sử dụng để sử dụng 2 cột độ rộng còn lại chia đều làm

<section class="py-5">
   <div class="container-fluid px-4">
      <h2 class="display-4 text-center">We speak _h2>

      <div class="row my-4">
         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">HTMLh3>
               <p class="lead">A simplified version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">CSSh3>
               <p class="lead">Another version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>

         <div class="col-md py-3">
            <section class="py-5 text-center bg-light">
               <h3 class="h2">JavaScripth3>
               <p class="lead">The next version of Englishp>
               <a class="btn btn-primary rounded-0" href="#">Learn morea>
            section>
         div>
      div>
   div>
section>
5 xung quanh 2 cột nội dung. Các phần tử con 3, 4, 5, 6 của
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
14 tự động được xuống dòng vì tối đa trong lưới 12 cột chỉ có thể hiển thị tối đa 2 cột của
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
17

Trong

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
52 chúng ta có thể ghi đè lên
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
53 để có màu nền chính xác như mong muốn

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
1

Như vậy là giao diện trang chủ của chúng ta cũng gần như đã hoàn chỉnh rồi. Mình tin là tới đây thì bạn đã có đủ tự tin để hoàn thành 2 phần còn lại là

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
54 và phần chân trang web. Bạn có thể lưu lại mã đầy đủ ở dưới đây để tham khảo và hoàn thiện trang chủ của bạn

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
5
/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
0

Như vậy là chúng ta đã thực hiện phương thức áp dụng Bootstrap đơn giản nhất để xây dựng một giao diện trang chủ đơn giản. Tuy nhiên, để có thể sử dụng Bootstrap ở mức tối ưu nhất và xây dựng các trang web có thiết kế phong phú hơn thì sẽ yêu cầu chúng ta học thêm JavaScript. Đây là 1 trong 3 ngôn ngữ bắt buộc phải biết đối với bất kỳ ai muốn học lập trình web

Nếu như HTML cho phép chúng ta cấu trúc nội dung của trang web, CSS cho phép chúng ta thiết lập phong cách hiển thị của các nội dung, thì JavaScript ở gần bên lại cho phép chúng ta viết kịch bản đáp ứng cho các thành viên . Hay nói cách khác, với HTML và CSS thì chúng ta có thể vẽ ra một giao diện người dùng, giao diện web hay giao diện phần mềm thì cũng chỉ là gọi tên nhau mà thôi, còn với JavaScript thì chúng ta có thể

Và tới đây thì mình hy vọng rằng bạn sẽ tiếp tục tham gia cùng với mình trong quá trình tự học thêm JavaScript nữa. Hẹn gặp lại bạn trong bài viết đầu tiên về JavaScript của

/* .. */

.bg-trees {
  background-image: url(https://s19.postimg.cc/bd31cyn6r/road.jpg);
  background-size: cover;
  background-position: center;
}

.py-7 {
  padding-top: 150px;
  padding-bottom: 150px;
}
55