Bootstrap : Fluid Layout

Membuat Fluid Layout dengan Bootstrap

Di Bootstrap kalian dapat menggunakan kelas .container-fluid untuk membuat fluid layout untuk memanfaatkan lebar viewport 100% di semua ukuran perangkat (ekstra kecil, kecil, sedang, besar, dan ekstra besar).

Kelas .container-fluid hanya menerapkan lebar: 100%, bukan lebar berbeda untuk ukuran viewport yang berbeda. Namun, layout akan tetap responsif dan kalian dapat menggunakan grid class seperti biasa. Lihat tutorial tentang bootstrap grid system untuk mempelajari lebih lanjut tentang grid class.

Contoh berikut akan membuat fluid layout yang menutupi 100% lebar layar.

<!DOCTYPE html>
<html lang="en">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title>Bootstrap 4 Fluid Layout Example</title>
<link rel="stylesheet" href="css/bootstrap.min.css">
<script src=""></script>
<script src="js/bootstrap.min.js"></script>
<nav class="navbar navbar-expand-md navbar-dark bg-dark mb-3">
    <div class="container-fluid">
        <a href="#" class="navbar-brand mr-3">Tutorial Republic</a>
        <button type="button" class="navbar-toggler" data-toggle="collapse" data-target="#navbarCollapse">
            <span class="navbar-toggler-icon"></span>
        <div class="collapse navbar-collapse" id="navbarCollapse">
            <div class="navbar-nav">
                <a href="#" class="nav-item nav-link active">Home</a>
                <a href="#" class="nav-item nav-link">Services</a>
                <a href="#" class="nav-item nav-link">About</a>
                <a href="#" class="nav-item nav-link">Contact</a>
            <div class="navbar-nav ml-auto">
                <a href="#" class="nav-item nav-link">Register</a>
                <a href="#" class="nav-item nav-link">Login</a>
<div class="container-fluid">
    <div class="jumbotron">
        <h1>Learn to Create Websites</h1>
        <p class="lead">In today's world internet is the most popular way of connecting with the people. At <a href="" target="_blank"></a> you will learn the essential web development technologies along with real life practice examples, so that you can create your own website to connect with the people around the world.</p>
        <p><a href="" target="_blank" class="btn btn-success btn-lg">Get started today</a></p>
    <div class="row">
        <div class="col-md-4">
            <p>HTML is the standard markup language for describing the structure of the web pages. Our HTML tutorials will help you to understand the basics of latest HTML5 language, so that you can create your own web pages or website.</p>
            <p><a href="" target="_blank" class="btn btn-success">Learn More »</a></p>
        <div class="col-md-4">
            <p>CSS is used for describing the presentation of web pages. CSS can save a lot of time and effort. Our CSS tutorials will help you to learn the essentials of latest CSS3, so that you can control the style and layout of your website.</p>
            <p><a href="" target="_blank" class="btn btn-success">Learn More »</a></p>
        <div class="col-md-4">
            <p>Bootstrap is a powerful front-end framework for faster and easier web development. Our Bootstrap tutorials will help you to learn all the features of latest Bootstrap 4 framework so that you can easily create responsive websites.</p>
            <p><a href="" target="_blank" class="btn btn-success">Learn More »</a></p>
        <div class="row">
            <div class="col-md-6">
                <p>Copyright © 2019 Tutorial Republic</p>
            <div class="col-md-6 text-md-right">
                <a href="#" class="text-dark">Terms of Use</a> 
                <span class="text-muted mx-2">|</span> 
                <a href="#" class="text-dark">Privacy Policy</a>

Output dari contoh di atas akan terlihat seperti ini:

Bootstrap Fluid Layout