Issue identified in the recent Bootstrap 4 update: now accepting offset-md-* instead of col-offset-md-* as the

I'm relatively new to Bootstrap 4.

Recently, I embarked on learning Bootstrap 4 but unfortunately, I've run into some issues already. I attempted to modify code directly from the Bootstrap 4 manual itself and encountered a problem with the offset feature not functioning correctly. The code itself is quite straightforward and doesn't involve extensive coding.

UPDATE: MAY 25, 2016 [12:35 PM (GMT+8)]:

When using Boootrap 3.3.6 release, col-md-offset-* functions properly. However, in Bootstrap 4, it fails.

The issue has been reported at https://github.com/twbs/bootstrap/issues/19966!

This is the code snippet I used:

 <!-- This contains the .red, .blue and .green classes -->
 <style> ... </style>

 <div class="container">
    <div class="row">

       <div class="col-md-4 red">
         Hello world
       </div>

       <div class="col-md-4 col-offset-md-4 green">
         Hello world
       </div> 

        <div class="col-md-4 col-offset-md-4 blue">
         Hello world
       </div> 

   </div>


Upon inspecting the Bootstrap file through Safari's web inspector and examining the CDN link, I discovered that there was no class called "col-md-offset-*", leading me to believe this functionality might be nonexistent in Bootstrap. Instead, I found the class md-offset-4, which worked similarly to the example in Bootstrap.

UPDATE: MAY 25, 2016 [9:03 PM (GMT+8)]:

In response to user Nate Conley's input, this information was sourced from at the time of editing. Any alterations made by the Bootstrap team remain uncertain at the time of writing.

https://i.sstatic.net/8bEHW.png

https://i.sstatic.net/adlPX.png

https://i.sstatic.net/XU58M.png

Ultimately, after modifying the code, everything now works flawlessly.

<style> ... </style>    


<div class="container">
    <div class="row">

       <div class="col-md-4 red">
         Hello world
       </div>

       <div class="col-md-4 offset-md-4 green">
         Hello world
       </div> 

        <div class="col-md-4 offset-md-4  blue">
         Hello world
       </div> 

   </div>

Q: Is the issue related to my browser, Safari (version 9.1), or potentially to Bootstrap version 4, maxcdn, etc.? Could this be a common bug in Bootstrap 4?

Answer №1

Successfully using col-md-offset-* in Bootstrap 3.3.6, but encountering issues in Bootstrap 4.

A recent issue I encountered led me to user vp_arth's recommendation on the Bootstrap 4 Development Repository on Github. Currently, the documentation for Bootstrap 4 grid system has not been updated, but you can access the modified version through these links:

a) Bootstrap Layout grid.md file

b) Examples of using the Grid System

In conclusion: The issue is not with the Safari Browser, CDN, or Bootstrap 4 itself, but rather with the outdated documentation at the time of writing. It will be updated in the next alpha release. More details can be found in the resolved issue thread I posted here :)

(9:30 PM GMT+8)

Answer №2

When styling your columns, opt for ml-*-auto instead of col-offset-* to properly position the following column.

Answer №3

According to the Bootstrap 4 documentation, the offset class should be referenced as .offset-md-*. As far as I know, Bootstrap 4 is not designed to maintain backwards compatibility. Personally, I find that removing the .col- prefix makes the code easier to understand and reduces the amount of typing required (only saving 4 characters, but every little bit helps).

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

The HTML dropdown menu becomes crowded with numerous <li menu items, leading to it wrapping

One issue arises when the number of menu items exceeds the capacity to fit on a single line, causing them not to wrap from left to right onto the second line. The desired outcome is for the second line of the menu to start on the left just like the first l ...

Curved edges on a text box featuring a scroll bar

I'm facing an issue with my website where I have a large amount of text in an html textarea that requires a scroll bar. The problem is, I'd like to add rounded corners to the textarea, but it doesn't look good with the scroll bar. Below is ...

Gliding over the problem with the Azure line

https://i.sstatic.net/7N3hO.jpg Is there a way to hide the opacity and font on hover? I have tried using outline: 0; in my CSS but there is still a blue line lingering. Any ideas on how to remove it? If you need to see the code and the issue I'm des ...

CSS Drop-Down Menu Fails to Function Properly in Firefox and Internet Explorer

Can you help me with this issue I'm having with my website design? In Google Chrome, Opera, and Safari, everything looks great. But in Firefox and the latest version of IE, it's a different story. Here is the HTML code: <div id="navbar"> ...

Modifying the Navbar link color in Bootstrap 4 specifically for the sign-up button: A Step-by-Step

I've been struggling to change the link color of the signup class in one of my navigation items to white. No matter what I do, the color remains default and does not change. Here is the code snippet: HTML <nav class="navbar navbar-expand-md bg-f ...

clicking on links to different sections of the page does not automatically bring you to the top of

I am working on a design similar to this: http://jsfiddle.net/MTWu5/ The layout consists of a centered page with a sticky header. The header contains menu links that lead to anchors within the page. My issue arises when clicking on these links - I would l ...

Disable form input fields while keeping all other elements enabled

Currently, I am facing a dilemma where I must deactivate specific input fields within a form. Given that there are numerous fields to consider, individually disabling each one seems impractical. Can anyone offer advice on how to disable a set of elements ...

How come the cubic bezier timing function works flawlessly just on the first try when staggered transitioning element opacity over time with CSS and a touch of JS?

I'm currently working on a menu overlay that expands to fill the screen when a user clicks a button in the corner. I'd like the menu items to fade in one by one, similar to the effect used on this website: Most of the functionality is there, but ...

Automatic panning of JavaScript on a map

Having some issues with the functionality of the pan function. It's working, but not quite how I need it to. Currently, I have a logo overlaying a map and I want to pan away from the logo automatically to show an infowindow (panning left or right). H ...

Hover over me to see the CSS animation translate upwards until it reaches a specific point

I am new to CSS animation and I am trying to create a circle that moves from one end to the other on hover. However, I am facing an issue where the circle goes off-screen when the browser size is changed. How can I make it stop at a certain point within th ...

Changing the background color of the canvas using Javascript

I want to create a rect on a canvas with a slightly transparent background, but I don't want the drawn rect to have any background. Here is an example of what I'm looking for: https://i.stack.imgur.com/axtcE.png The code I am using is as follo ...

Ways to center an image without relying on margin or padding to achieve alignment

Is it possible to center all tags except for the img without using margins or paddings? header { display: flex; flex-direction: column; align-items: center; } .logo { border-radius: 50%; width: 100px; height: 100px; margin: 10px 0 0 10px; ...

Make sure to utilize the className attribute when styling a Material-UI component

I am attempting to apply CSS styles to a Material-UI component. defined in MyCss.css .trackTitle { color:white; } located in myComponent.js import "./MyCss.css" <Grid container item xs={1} className="trackTitle"> change col ...

How can I ensure that the gradient coordinates remain constant even if the screen size is adjusted?

*{ padding: 0; margin: 0; box-sizing: border-box; } .sky{ width: 100%; height: 400px; background-color: rgb(92, 217, 255); background-image: radial-gradient(circle at 46.5% 47%, white, white 3%, rgba(255, 0, 0, 0) 4%), ...

Move the focus to the previous input field by removing the key

I have created a phone number input with 10 fields that automatically skip to the next field when you fill in each number. However, I would like to be able to go back to the previous field if I make a mistake and need to delete a digit. How can I achieve ...

Encountering an issue while attempting to install an SSL certificate on my server. The error message displayed is: "ERROR:

Unique HTML Code: <html> <head> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <link rel="stylesheet" href="farmapp.css"> </head> <body onload=&qu ...

Footer displays within the content section

Currently, I am utilizing Next.js and antd's layout components to create a dashboard-style page using their Layout component. However, I have encountered two issues related to styling (CSS) in this setup: Footer appearing within the Content: I am wo ...

Incorporating Bootstrap Content: A Guide to Including a PHP File within Another PHP File

I am encountering an issue when trying to import a PHP file containing my navigation bar into another PHP file. Here's the code for the navigation file: <?php echo " <html> <head> <nav class = "navbar navbar-default navbar-fixed-top ...

caption sliding into the incorrect div box

As I continue my journey of learning CSS, I've encountered a puzzling issue involving slide-in captions within a different div element. The problem arises when I try to customize the appearance of the caption to better fit the overall design of my web ...

Tips for creating a responsive design for this division device

There is a video playing in the background, with two sections overlaying it - one for sketches and the other for text. The issue I am facing is that when I resize the window, the text overflows. I have tried using Bootstrap and CSS (media queries, flex) bu ...