Bootstrap 4 documetration says:
Extra small devices (portrait phones, less than 576px)
It is clear that extra small are devices whose screen width is less than 576 px. Well, less than 576 px ... and how less? The grid cannot decrease to zero. There is a limit to which the layout using the Bootstrap grid can be compressed without noticeable design distortions. In addition, there are devices with a screen width that is much smaller than 576 px (320 or 240 px).
If we mathematically represent the supported screen width for extra small devices as an interval, we get [a, b)
, where b = 576
according to the documentation.. So then... what is a
equalled to? The documentation does not cover this question.
There is an adaptive header in the code example below (container-fluid with row and 12 columns). In the developer’s tools in Chrome I found the value a = 360
that is the last value on which the grid is not yet distorted (witha = 359
, the 12th column does not fit in width and goes to the "new row").
Of course, I can reset the paddings and then everything fits both 320 and 240 px, but this solution is not out of the box:
.row > div {
padding: 0;
}
Is 360 px really the minimum supported screen width in Bootstrap 4?
Example for quick viewing:
.header {
background: rgb(240,240,240);
min-height: 70px;
border-bottom: 1px solid gray;
align-items: center;
text-align: center;
}
.logo {
border: 1px dashed black;
height: 40px;
width: 100px;
display: inline-block;
}
<link href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" rel="stylesheet"/>
<link href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" rel="stylesheet"/>
<div class="container-fluid">
<div class="row header">
<div class="col-1">
<i class="fas fa-bars"></i>
</div>
<div class="col-9 text-center">
<div class="logo">Logo</div>
</div>
<div class="col-1">
<i class="fas fa-shopping-cart"></i>
</div>
<div class="col-1">
<i class="fas fa-search"></i>
</div>
</div>
</div>
The same code for a simple copy to a text editor (maybe someone wants to look into the dev tools):
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<title></title>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/css/bootstrap.min.css" integrity="sha384-GJzZqFGwb1QTTN6wy59ffF1BuGJpLSa9DkKMp0DgiMDm4iYMj70gZWKYbI706tWS" crossorigin="anonymous">
<link rel="stylesheet" href="https://use.fontawesome.com/releases/v5.6.3/css/all.css" integrity="sha384-UHRtZLI+pbxtHCWp1t77Bi1L4ZtiqrqD80Kn4Z8NTSRyMA2Fd33n5dQ8lWUE00s/" crossorigin="anonymous">
<script src="https://stackpath.bootstrapcdn.com/bootstrap/4.2.1/js/bootstrap.min.js" integrity="sha384-B0UglyR+jN6CkvvICOB2joaf5I4l3gm9GU6Hc1og6Ls7i6U/mkkaduKaBhlAXv9k" crossorigin="anonymous"></script>
<style type="text/css">
.header {
min-height: 70px;
border-bottom: 1px solid gray;
align-items: center;
text-align: center;
}
.logo {
border: 1px dashed black;
height: 40px;
width: 100px;
display: inline-block;
}
</style>
</head>
<body>
<div class="container-fluid">
<div class="row header">
<div class="col-1">
<i class="fas fa-bars"></i>
</div>
<div class="col-9 text-center">
<div class="logo">Logo</div>
</div>
<div class="col-1">
<i class="fas fa-shopping-cart"></i>
</div>
<div class="col-1">
<i class="fas fa-search"></i>
</div>
</div>
</div>
</body>
</html>