The outcome of the Bootstrap 4 grid layout was not what I had anticipated

When referring to the Bootstrap4 documentation, we find classes like col-*-num and offset-*-num for structuring page layouts. In the code snippet below, the column divisions from sm size and up are consistent, but there is a discrepancy in the layout for the extra small view. To address this issue, I have utilized col-sm-* for small size and above, and col-xs-* for the extra small view. While the layout appears as expected for sizes labeled as small and above, all columns seem to occupy their own row in the extra-small view. This has led me to question my understanding of Bootstrap4 concepts - what could be causing this unexpected behavior?

HTML

<body>
        <div id="top-ribbon" class="container-fluid">
            <div class="row align-items-center">
                <div id="logo" class="col-xs-2 offset-xs-1 col-sm-2 offset-sm-2 d-flex align-items-center justify-content-center color-white">Hello
                </div>
                <div id="socials" class="col-xs-3 offset-xs-2 col-sm-2 offset-sm-6 d-flex align-items-center justify-content-around color-white">
                        0256666666<i class="fa fa-phone color-white"></i>
                </div>
            </div>
        </div>
        </body>

Css

#top-ribbon{
    background-color: rgb(168, 8, 133);
}
#socials i{
    font-size: 20px;
}

#socials, #logo{
    border: 1px solid;
}
.color-white{
    color: white;
}
#top-ribbon1{
    background-color: rgb(168, 8, 133);
}
#socials1 i{
    font-size: 20px;
}

#socials1, #logo1{
    border: 1px solid;
}

JSFiddle

Answer №1

Starting from version 4.0.0-alpha.6, the use of -xs infix has been eliminated. According to the latest update on the official blog:

The decision was made to remove the -xs infix from our extra small breakpoint. Unlike sm, md, lg, and xl breakpoints that apply styles based on a minimum width requirement, xs applies to all elements without a specific bound @media query.

As a result, col-xs-2 offset-xs-1 should now be written as col-2 offset-1, and col-xs-3 offset-xs-2 should be replaced with col-3 offset-2.

Similar questions

If you have not found the answer to your question or you are interested in this topic, then look at other similar questions below or use the search

Achieve proper alignment between a label and textbox using CSS styling

While the title may lead you to believe this is just another CSS issue, it's actually a bit different. I have a textbox with a placeholder property and a applied CSS class. Now, I need to add a label to signify it as a mandatory field. The problem ari ...

Manipulating parent based on first child using CSS

Is it possible to manipulate the parent element using CSS based on the presence of a specific child? For instance, I want to style a table cell differently if the first child within it is a link. <td>Hello</td> <td><a href="go.html"& ...

When the JavaFX ComboBox drop-down opens in an upwards direction, the border appears incorrectly

While working with Java 8, I encountered an issue with the "javafx.scene.control.ComboBox" where if it doesn't have enough room below, it pops up instead. Strangely, the border styling of the elements still behaves as if it should pop down. Is there ...

What is the method to customize the color of the "Download to Excel" button on the Kendo Grid toolbar?

I'm looking to personalize the color of the "Export To Excel" button provided by the Kendo grid UI in the toolbar: https://i.sstatic.net/UYug5.png While I've successfully altered the color of the toolbar itself using the following definition in ...

Modify the displayed image when hovering using inline coding techniques

I am having trouble changing an image on hover. I have attempted various methods without success. However, I need to stick with something similar to this code. Please let me know if there are any issues with this code. Thank you in advance. Code < ...

Is there a way to give only the left corners of a button a rounded look?

Here is the visual representation of the button: https://i.stack.imgur.com/Bjlkp.png ...

Align watermark content to the far left side

Having trouble getting my watermark to align properly on the left side of my website's main content. Here is how it currently looks: https://i.sstatic.net/Nfhh5.png The issue arises when I resize the screen or switch to mobile view, as the watermark ...

When rails code is placed within haml tags, it results in generating empty spaces within the HTML tags of browsers

Every time a rails variable is nil (or when using rails code (as seen in the third code example)), my html displays a string of empty characters. new.html.haml %h1.editable.editable_title_field{:contenteditable => 'true', :placeholder => ...

Is there a way to eliminate the underline in TextField components in Material-UI?

Is there a way to remove the underline from a material-ui TextField without using InputBase? I would prefer to stick with the TextField API, but have not been able to find a solution in the documentation. ...

The main page's navbar dropdown menu fails to appear after a certain length

I've encountered a strange problem with my navbar. I utilized an online template, and the issue is that on the main page, the dropdown menu doesn't extend fully; it only goes as far as the length of the navigation bar (Refer to the image below). ...

Having issues with the functionality of Bootstrap 4 popover?

In my Spring MVC web project, a Bootstrap popover appears when the help icon is clicked. However, on the first click, the popover opens and moves away from the icon. After closing it and clicking again, the popover correctly positions itself. When I chan ...

What can be done to prevent inputs from shifting when resizing a browser window?

I am struggling to align checkboxes and text on a PHP form I am creating. No matter what I try, they end up misaligned when the browser is resized. Any suggestions on how to solve this alignment issue without changing the format of the rest of my page wou ...

Unable to apply .png image using the content property in a Symfony project

I have a png image located in src/AppBundle/Resources/public/img To set the png image using the css content property, I used this code: content: url(../../public/assets/img/optional-checked.png); However, I encountered an error: GET http://127.0.0.1:80 ...

Neglecting Margins: The Challenge of Specificity

While utilizing the Foundation 4 framework, I've encountered an issue where the margins are being overridden by the framework's default settings. This situation forces me to use the !important keyword to apply margins to specific elements. Below ...

Tips for handling numerous buttons in ionic?

I'm currently working on an app that includes surveys. In this app, users are required to answer by selecting either the Yes or No button. The desired behavior is for the chosen button to turn blue once clicked, while the other button should maintain ...

Problem with the "seconds" not being displayed for editing in the date range time selector

When using a date time range picker, I noticed that there is a field to edit "seconds" when editing the date (refer to link 1). However, when I switch to a date range picker, this option to edit seconds is not available (refer to link 2). Can you help me u ...

How can one effectively pass arguments to jQuery in order to set the tooltip text for Bootstrap from an element within the HTML body

I'm working with a simple markup that triggers a colorful bootstrap tooltip when hovering over a button in the body. Currently, the tooltip text is hardcoded into the jQuery function. I want to find a way to pass the tooltip text to the jQuery functio ...

Achieve Vertical and Horizontal Alignment of a div within another div using the :after selector

I currently have this HTML and CSS code: html { overflow-x: hidden; overflow-y: hidden; } body { margin: 0; } .triangle-down { width: 90%; height: auto; padding-left: 50%; padding-top: 50%; overflow: hidden; } .triangle-down:after { co ...

Position filter forms on the left side to align with bootstrap cards

I'm having trouble aligning the cards using Bootstrap's row and col- classes. The first three are behaving as expected, but the fourth one isn't cooperating. Any idea why this might be happening and any solutions you can suggest? View the i ...

I'm having trouble with jQuery recognizing the left-margin property. Is there a workaround for this issue?

I rarely use jquery, but I wanted to add animation to a side bar. The sidebar menu is 670px with a -670 left-margin. When the user hovers over it, I'd like the left-margin to change to 0px and reveal the hidden content. Upon mouseout, it should return ...