GRID system bootstrap - col-xs-X does not recognize width

0

I'm studying bootstrap, and in formulating the GRID system the col recognizes the values LG, MD, SM, but does not recognize the requested XS. When I resize the browser to mobile size it always puts the requested div in size 12 (full).

<!DOCTYPE html>
<html>
<head>
    <title>Bootstrap Bill Turner</title>
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <link href="css/bootstrap.min.css" rel="stylesheet" media="screen">
    <link href="css/estilo.css" rel="stylesheet" media="screen">  
</head>   
<style>
    .c{
        background-color:aquamarine;
        border-right:1px solid black;
    }
</style>
<body>
    <div class="container">

        <div class="row">
            <div class="c col-lg-12 col-md-12 col-sm-6 col-xs-1">
                esp
            </div>
            <div class="c col-lg-12 col-md-12 col-sm-6 col-xs-1">
                esp
            </div>
            <div class="c col-lg-12 col-md-12 col-sm-6 col-xs-1">
                esp
            </div>
            <div class="c col-lg-12 col-md-12 col-sm-6 col-xs-1">
                esp
            </div>

        </div>

    </div>
    <script src="js/jquery-3.2.1.min.js"></script>
    <script src="js/bootstrap.min.js"></script>
    <script src="js/main.js"></script> 
</body>

When resizing to mobile, it has the following layout:

Browser resized for mobile resolution

Someone to give me a light on what I'm doing wrong?

A print with the complete code, and the three forms of visualization: Full code and 3 forms of visualization As you can see, all right, except in COL XS. (I did not start LG because I did not have space in the same print)

    
asked by anonymous 23.10.2017 / 20:49

3 answers

0

By reading the documentation you will see that there was a change, it became simpler instead of col-xs-N Now you can only col or col-N , see below:

In this example, we create 4 columns by reporting in the class attribute the value col , see they are on the same line because the value has been divided. >

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
         <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" />
        <style>
            .c{
                background-color:aquamarine;
                border-right:1px solid black;
            }
        </style>
    </head>
    <body>
    <div class="container">
        <div class="row">
            <div class="c col-lg-12 col-md-12 col-sm-6 col">Esp 1</div>
            <div class="c col-lg-12 col-md-12 col-sm-6 col">Esp 2</div>
            <div class="c col-lg-12 col-md-12 col-sm-6 col">Esp 3</div>
            <div class="c col-lg-12 col-md-12 col-sm-6 col">Esp 4</div>
        </div>
    </div>
        <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js"integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
    </body>
</html>
  

For some reason Snippet does not work here in SOpt but I put Print and can test that it works.

InthisotherexamplewereportavalueNforcol

<!DOCTYPE html>
<html>
    <head>
        <meta charset="utf-8">
         <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
        <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/css/bootstrap.min.css" />
        <style>
            .c{
                background-color:aquamarine;
                border-right:1px solid black;
            }
        </style>
    </head>
    <body>
    <div class="container">
        <div class="row">
            <div class="c col-lg-12 col-md-12 col-sm-6 col-2">Esp 1</div>
            <div class="c col-lg-12 col-md-12 col-sm-6 col-2">Esp 2</div>
            <div class="c col-lg-12 col-md-12 col-sm-6 col-8">Esp 3</div>
            <div class="c col-lg-12 col-md-12 col-sm-6 col-12">Esp 4</div>
        </div>
    </div>
        <!-- jQuery first, then Popper.js, then Bootstrap JS -->
    <script src="https://code.jquery.com/jquery-3.2.1.slim.min.js"integrity="sha384-KJ3o2DKtIkvYIK3UENzmM7KCkRr/rE9/Qpg6aAZGJwFDMVNA/GpGFF93hXpG5KkN" crossorigin="anonymous"></script>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/popper.js/1.12.3/umd/popper.min.js"integrity="sha384-vFJXuSJphROIrBnz7yo7oB41mKfc8JzQZiCq4NCceLEaO4IHwicKwpJf9c9IpFgh" crossorigin="anonymous"></script>
    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-beta.2/js/bootstrap.min.js"integrity="sha384-alpBpkh1PFOepccYVYDB4do5UnbKysX5WZXm3XxPqe5iKTfUKjNkCk9SaVuEZflJ" crossorigin="anonymous"></script>
    </body>
</html>
The First and Second columns will occupy 2 spaces in the Grid, and the Third will occupy 8 spaces, and finally the Fourth column that will occupy 12 spaces in Grid .
  

For some reason Snippet does not work here in SOpt but I put Print and can test that it works.

Reference

  • Grid options
25.10.2017 / 18:06
0

Hello, the way it should work. See your code running. link

You may not have specified the metaport viewport in your html.

<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no">
    
23.10.2017 / 20:53
0

You have to look at this resizing, in the sense that you are actually resizing to mobile, because you may be resizing to tablet, where the tablet uses the sm class.

What's more, it has a 'c' class before the measurements. Is that correct? Do you really have this class (in upper case)?

<div class="C col-lg-12 col-md-12 col-sm-6 col-xs-1">
 esp
</div>

Here is the article that can help.

    
23.10.2017 / 21:35