Guide to converting Bootstrap class col-md-10 to col-md-12 within a div using CSS

For my project, I utilized a thumbnail section and a view section. To achieve this layout, I divided the parent div into two separate divs. The first div is col-md-3 (the thumbnail section) and the second div is col-md-9 (the view section). Now, I am looking to hide the first div and change the second div to col-md-12 for smaller devices such as mobile or iPad.

Is there a way to accomplish this using media queries?

Answer №1

The Bootstrap column system for grids is very intuitive. When you use col-md-3, you're essentially saying "on medium screens, give this column 3 blocks". You can also utilize col-sm-12 to make it span the entire row on large screens and col-sm-0 to hide it on smaller screens. For a more detailed explanation of the Bootstrap grid system, check out this link: https://getbootstrap.com/docs/4.1/layout/grid/

Answer №2

<div class="row">
  <div class="col-md-3 d-none d-sm-none d-md-block">THUMBNAIL ELEMENT</div>
  <div class="col-md-9">Some important information</div>
</div>

This solution will address your problem. The thumbnail element will be hidden on extra small and small screens.

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

Choosing a different value in JS leads to the same outdated result being shown

I am currently tackling calculus and encountering an issue with re-selecting values in my calculation. Below is the complete program that I am working on: Link to Program After selecting a value and clicking submit, everything works perfectly. However, i ...

Sorting with jQuery datatable plugin leads to the alternative backcolor being disrupted

I'm working with the jquery datatable plugin and have a piece of code that I've set up to provide alternating background colors for an html table. $('#dependenciesTabletr:odd td').addClass('odd'); $('#dependenciesTabletr ...

Having difficulty with delaying the loading of a div layer and javascript after the page has initially loaded

I've been struggling to make this script wait a few seconds after the page has loaded, but I haven't been successful so far. Despite trying some solutions from similar questions here, nothing seems to be working. Any help you can provide would b ...

Using PHP to insert CSS conditionally through an if statement

I am working with PHP to identify whether a user is accessing the website through a mobile device or desktop browser. Currently, I have it set up to display "yes" or "no," which is working correctly. However, I would like to apply specific CSS code based o ...

Verify if an express module has a next() function available

Is there a method to check if there is a function after the current middleware? router.get('/', function(req, res, next){ if(next){//always returns true } }); I have a function that retrieves information and depending on the route, thi ...

The API is now configured to provide a single result rather than returning multiple results in response to an 11ty/elevent

In my 11ty project (static site generator), I am fetching property data and then using it in a Promise.all call to: fetch all property images fetch tenancy application URLs After that, I combine these into one array named allData for my pages. The image ...

Create an input element using JavaScript/jQuery

Looking for some help with Javascript on a simple task. When a specific option is chosen, I want to add an input field to a div element. <select name="amount" > <option value="50">50$</option> <option value="100">100$</o ...

Express server failing to serve js and css files

Currently, I'm working on a ReactJS project with React Router implemented. When attempting to access /dashboard/stream, the server is returning the index.html file successfully. However, there are 301 errors for the CSS and JS files, resulting in noth ...

JavaScript: Assigning a value to an object using the ID which corresponds to the last letter of the object

Regarding the heading: it may appear confusing at first, but it's actually quite straightforward. Currently in React, I am focusing on code reusability. Here is the initial state: state={ colorObj1: {r:'0',g:'0',b:'0 ...

Stop Sublime Text from automatically calculating Less2Css

Within my workflow using Sublime Text and Less2Css for dealing with less files, I encountered an issue where specifying the max-height of a container as 100% - 20px resulted in minification reducing it to '80%'. Is there a way to work around this ...

JavaScript code to record the time when a client exits my website by clicking the X button in the top right corner and save it in my database

I need to record in the database the times when users enter and exit my site. Saving the entry time is not an issue, nor is saving the exit time by clicking my "log off" button. However, what about when a client exits by clicking the X in the right corner ...

The error message "reload is not defined" indicates that the function reload

Initially, I encountered the error TypeError: require(...) is not a function, prompting me to add a semicolon at the end of require("./handlers/slashcommands"). However, this led to a new issue: ReferenceError: reload is not defined. This occurre ...

Center an image vertically and horizontally within a div element inside a container, even if the image sizes and aspect ratio differ, while also including padding

I am looking to vertically align images with varying ratios, where the image may be larger or smaller than the content and also include padding; I have tried different solutions found here, but none seem to cover all my requirements; I specifically need i ...

Obtain asynchronous state in VueJS without the need for intricate v-if conditions

I am working on an application that heavily relies on Vue-Router and Vuex for state management. Within the Dashboard component, important user information is displayed. This data is fetched asynchronously from a database by Vue and then stored in Vuex. T ...

Verification prompt box when delete button is pressed

I've been diving into an app built with Angular. Currently, I have a delete button that triggers a confirmation dialog on onClick(). <a class="delete button" href="#" onClick="return confirm('Are you absolutely sure you want to delete?' ...

Ways to change a CSS rule for a class when the data-attribute value aligns with an anchor tag's value?

Looking to incorporate read more links into various sections of a WordPress page, where clicking the link reveals content hidden with CSS. Here are a couple of sample sections in HTML format that I aim to replicate: Section 1: <p>Curious about what ...

Canvas does not display any results when trying to integrate Shadertoy

While browsing through StackOverflow, I came across a post detailing how to transfer shader examples from ShaderToy into Three.js. You can find the post here. I followed the steps mentioned in the post and created this Plunker demo. The fragment shader co ...

The process in mocha does not execute when using await

"It" in the Mocha testing framework does not execute when using the await keyword. My approach involves employing functions for asynchronous file reading and then processing the test based on the returned value. I utilize these file read functions multipl ...

Is it possible to alter the color of the cursor without affecting the color of the text

My preference is to have the cursor color set to #FFF while keeping my font color at #000. Can this be achieved? ...

Automating button clicks after a component has loaded in Angular 2+ can be achieved by implementing a

Currently, I am working on implementing an automatic search function in Angular that triggers after a component loads. Right now, the function is triggered by a button click, but I want to automate this process. <button mat-raised-button class="mat-whi ...