Splitting four columns into two columns using Bulma CSS

Here is the code snippet I am working with:

<div class="columns">
    <div class="column">column 1</div>
    <div class="column">column 2</div>
    <div class="column">column 3</div>
    <div class="column">column 4</div>
</div>

I am trying to achieve a similar layout using Bulma CSS. You can view the desired layout on this CodePen link: https://codepen.io/hashem/pen/ausJL

However, when resizing to the mobile version, the columns break into 2 columns instead of the original 4.

Answer №1

Here is a solution to your question:

<div class="columns is-mobile is-multiline">
  <div class="column is-half-mobile">column 1</div>
  <div class="column is-half-mobile">column 2</div>
  <div class="column is-half-mobile">column 3</div>
  <div class="column is-half-mobile">column 4</div>
</div>

If you need the columns to wrap when the screen size decreases, use this code snippet:

<div class="columns is-mobile is-multiline">
  <div class="column">column 1</div>
  <div class="column">column 2</div>
  ...
</div>

For more detailed information on this topic, refer to the following links:

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

Maintaining aspect ratio in CSS grid layouts

I am in the process of designing a CSS grid layout where I want to maintain the same height for all columns. Additionally, I would like the first item to have a 16:9 aspect ratio. However, I am encountering an issue where the images are not fitting perfect ...

Creating Sleek Tables - comparing the benefits of using table-layout:fixed versus setting individual td-width to

Several weeks ago I posted a query (Table overflows parent div when td content is too wide) related to table design. The response I received seemed to resolve the issue perfectly. Now, as I attempted to redesign the table yesterday, I encountered a challen ...

Using jQuery to swap an image with a div element and then using the image as the

I have a collection of images in a div, like so: <div class="image-container"> <img width="174" height="174" src="http://mysite.com/images/portfolio/p1.jpg" class="image-style" typeof="foaf:Image"> <img width="174" height="174" src= ...

When the browser width is insufficient to display everything side by side, items will wrap to the next

I'm working on a sleek top menu design that features a logo on the left and inline links on the right: * { margin:0; padding: 0; } #header { background-color: grey; } #right { background-color: blue; float:right; } #left { background-color: green; ...

What is the best way to incorporate bootstrap into a react project?

import './App.css'; import TodoList from './components/TodoList'; import 'bootstrap/dist/css/bootstrap.min.css' function App(){ return( <div className="my-todo-app"> <TodoList/> ...

In what way does a child's width vary when set to "100%" or "inherit" from its parent element?

Can a Child element, nested within a Parent, have a width that is different from the parent's width when: 1) the Child's Width is set to 100% 2) the Child's Width is set to 'inherit'? I am experiencing both scenarios. It is challe ...

How can I use Angular 7 to create a background image for a View made up of multiple components?

Here is the HTML code that I am working with: <app-navbar></app-navbar> <router-outlet></router-outlet> My goal is to have an image set as the background for the home view, which consists of two components: navbarComponent and hom ...

What is the reason behind certain vanilla JavaScript libraries necessitating NPM?

I am a beginner in JavaScript and I want to learn more about it. Recently, I discovered a library called bounce.js which is an animation library. However, it requires NPM for installation, but I am hesitant to use NPM or any packet Manager because they hav ...

What is the best way to place a search icon beside my label?

Hello there! I am currently working on designing in Angular 4 using bootstrap 4. I attempted to include a search icon at the end of my label. The code is as follows: <div class="row "> <div class="form-group col-lg-2"></div> <div ...

Tips for activating this effect even when the window is resized during page scrolling

There's a code snippet that enables the header to become unfixed when a specific div reaches the top of the screen and then scrolls with the rest of the content. While this solution works perfectly, I encountered a problem where the calculations for ...

Creating a blank webpage after including a component tag for an Angular form

I encountered an issue while developing an Angular form. It seems that using the app-name-editor tag causes my entire HTML page to go blank, and the form does not display. However, removing the tag restores the webpage's functionality. This leads me t ...

Why does my Div seem to be ignoring the height inherited from the html or body elements?

Is there a way to make the landing-wrapper div expand to fill 100% of the screen on a landing page? Many suggestions advise setting the html/body height to 100%. I've already tried that, but it doesn't seem to be working. I'm using React and ...

Tips for perfectly aligning elements (such as text and images) within the navbar

Hi everyone, I hope you're doing well. Currently, I'm working on aligning a small icon with some text. I've tried using the d-inline class inside the a tag, but it doesn't seem to be working. Another issue I'm facing is related to ...

HTML slider overlaps fixed buttons

I have a fixed button on my HTML site that redirects to another link. It appears correctly on most pages, but overlaps with the slider on my index page. $(document).ready(function(){ // hide #back-top first //$(".back-top").hide(); // fade in # ...

I'm working on creating a login page with Bootstrap. Does anyone know the best way to center it on the screen

For a school project, I am working on creating a sign-in page. Although I have come across this code, it does not appear at the center of the page as intended. Instead, the left side displays to the left while the right side shows up to the right. My goal ...

The navigation bar on the web app is functioning properly on Android devices but experiencing a CSS problem on

My Nextjs web app includes a navbar with a hamburger menu, logo, and avatar. The navbar functions perfectly on desktop in Chrome, Mozilla, Brave (in developer tools mobile mode), and on Android phones using Chrome. However, when accessed from an iPhone X, ...

Code snippets to reduce excess white space on a website using HTML and CSS

On my website, there are multiple tabs, each containing content from an HTML file. When a user clicks on Tab1, boxes with images are displayed. The layout can be seen in the following Code Demo: Code Demo here There seems to be extra space before and afte ...

Aligning items in the center using the flex property is limited to just one element

#draggable-container { margin: 0 auto; display: flex; flex-wrap: nowrap; align-items: center; } .draggable-game-content { width: 100%; height: 40rem; } .draggable-game { position: relative; border: 1px solid black; bor ...

Employing AJAX to utilize keyboard arrow keys for selecting elements in an autocomplete feature

I am currently working on creating an autocomplete search box using a combination of Ajax, PHP, and jQuery. While I have successfully implemented the ability to select items from the search results using a mouse, I am now looking to enhance the functional ...

The drag functionality can only be used once when applied to two separate div elements

Recently, I came across an issue where I have both an Image and a custom text element placed between them using an input box. My goal is to make both the text and the image draggable on the page. However, I noticed that while the image can be dragged and d ...