What is the best way to end a column early using a media query?

I need some help with adjusting the card layout in my project. I want the cards to break at a specific window size of 700px, but it's not working as expected. Can anyone provide guidance on how to achieve this? Thank you in advance for your assistance :)

<html>
                <head>
                    <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0-alpha.2/css/bootstrap.min.css" integrity="sha384-y3tfxAZXuh4HwSYylfB+J125MxIs6mR5FOHamPBG064zB+AFeWH94NdvaCBm8qnd" crossorigin="anonymous">
                    <link href="https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css" rel="stylesheet" />
                    <link href="https://fonts.googleapis.com/css?family=Roboto:300,300i,400,400i,500,500i,700,700i" rel="stylesheet">
                    <!--jQuery library-->
                    <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.12.4/jquery.min.js"></script>
                    <!--Latest compiled and minified JavaScript--> 
                    <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/js/bootstrap.min.js"></script>
                    <style type="text/css">
                        .card-body {
                            padding: 0 !important;
                        }
                        .card-content {
                            padding: 1.25rem;
                        }
                    </style>
                </head>
                <body>
                <div class="row my-4">
                    <div class="col">
                        <div class="container-fluid">
                            <div class="row">
                                <div class="col-sm d-flex">
                                    <div class="card card-body flex-fill">
                                        <div class="card-header"><center>Education</center></div>
                                            <div class="card-content">
                                                <h5 class="card-title">● hello hello hello hello hello 2019</h5>
                                                    <p class="card-text"><br>blah blah blah blah blah blah blah</p>
                                                <h5 class="card-title"> ●hello hello hello hello helooo</h5>
                                                    <p class="card-text">something...................................................</p>
                                                <h5 class="card-title"> ● hello hello hello hello hello</h5>
                                                    <p class="card-text">sometthing here........................</p>
                                            </div>
                                    </div>
                                </div>
                                <div class="col-sm d-flex">
                                    <div class="card card-body flex-fill">
                                    <div class="card-header"><center>Traings & Online Courses</center></div>
                                        <div class="card-content">
                                            <h5 class="card-title">TRAINING</h5>
                                                <p class="card-text">● .........................................................<br> ● ..............................................</p>
                                            <h5 class="card-title">ONLINE COURSE 2015</h5>
                                                <p class="card-text">● blah blah blah blah..... <br>
                                                ●blah blah blah blah blah.</p>
                                            <h5 class="card-title">ONLINE COURSE 2015</h5>
                                          </div>
                                   &</div>
                               </div>
                           </div>
                      </div>
                  </div>
              </div>
          </body>
       </html> 

Answer №1

Check out this code snippet for CSS styling and HTML structure:


.card-body {
    padding: 0 !important;
}
.card-content {
    padding: 1.25rem;
}
@media only screen and (max-width: 992px) {
    #edu1 .card {width:700px;height:700px;background:red;}
}

This snippet includes some CSS rules for card styling and an example of an HTML structure for displaying education details and online courses.

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

AngularJS dynamic data table for interactive and flexible data presentation

I am looking to implement a dynamic data table using AngularJS, with the first column containing checkboxes. The data will be in JSON format as shown below, $scope.items = [ { "id": "1", "lastName": "Test1", "firstName": "Test", "email": "<a hr ...

Converting HTML's nested <ul> element into JSON format

I am working on developing a form builder application that allows users to create forms through drag and drop functionality. The main structure of my form is based on the <li> tag, with nested <li> and <ul> tags present underneath it. On ...

Struggling with a filtering and sorting problem in my code, looking for some assistance

I'm encountering an issue with an isotope filter menu. The goal is for it to load data based on a timestamp and allow filtering. However, there seems to be a conflict between my sortBy script and the filter script. Below is the code in question: Sor ...

Attempting to change the appearance of my jQuery arrow image when toggling the visibility of content

Here is a sample of my JQuery code: $(document).ready(function() { $(".neverseen img").click(function() { $(".neverseen p").slideToggle("slow"); return false; }); }); Below is the corresponding HTML: <div class="neverseen"> <h1> ...

Prevent event propagation in jQuery by using .stopPropagation() when hovering over a

When trying to implement event.stopPropagation() in a specific scenario, I encountered an issue with a blinking background image on my submenu. To address this, I added a pseudo-element (background:green) to the parent element by toggling a new class using ...

How can I retrieve and showcase the size of each file, including images, CSS, and JS, present on a website?

Currently, my goal is to create a dashboard capable of retrieving the file size for all resources (images, javascript, css, etc.) loaded on a webpage. I aim to then further filter these resources by file type and file size in order to identify which ones c ...

How can one generate an HTML element using a DOM "element"?

When extracting an element from an HTML page, one can utilize a DOM method like .getElementById(). This method provides a JavaScript object containing a comprehensive list of the element's properties. An example of this can be seen on a MDN documentat ...

Arrays in Javascript (correlating)

I'm having trouble figuring out what needs to be included in this code (I apologize that it's in German, it's an array corresponding to images for JavaScript.) function namenZuBildern(){ var bilder = new Array( "000227", "000228", " ...

Is there a way to format the text into a curved half-capsule shape?

<div class="bg-primary rounded-pill"> <p class="text-right"> TOTAL AMOUNT </p> <p class="text-right"> 200 </p> </div> I would like the text within a div element to appear in a capsule shape. Is there a way t ...

Toggle sideBar within an iFrame by implementing Media Queries

I have implemented media queries in my code to hide the .sideBar when the screen resolution is less than 768px, showing only the .main section. @media (max-width: 768px) { .sideBar { display: none !important; } } Now, I want to add a ha ...

Having trouble loading popper.js using Laravel mix and webpack

I have been working on my project with Bootstrap 4 beta and Laravel 5.4, using npm and Laravel mix to load my JavaScript dependencies. Everything was going smoothly until I encountered an error while trying to use Bootstrap JavaScript methods. The error me ...

What steps do I need to follow in order to create an AJAX application that functions similarly to node

As someone new to ajax, I am facing challenges while trying to create a forum software similar to nodebb. Despite having developed a php forum previously, its outdated appearance prompted me to seek alternatives like nodebb for a more modern look and feel. ...

Struggling with identifying errors in the Javascript code for my assignment

My code is giving me trouble and I could really use some assistance You can find my code in this GitHub folder: link. To see the project in action, visit this page on GitHub Pages: link. The task involves iterating over an array of names and printing eit ...

Using identical CSS for two separate layouts

Imagine having to work with an html page that cannot be altered in any way. The only tool at your disposal is CSS. The page is loaded and shown through an iframe from a different domain. This particular page serves as a payment gateway, displaying either ...

Looking for Angular 2 material components for dart with CSS styling? Need help centering a glyph on your page?

HTML: <div class="border"> <glyph class="center" [icon]="'star'" ></glyph> <div class="centerText"> This Is Text that is centered. </div> </div> Css: .centerText{ text-align: center ...

What is the best way to fetch images from a JSON object in a React application?

I have been trying to load images from an array of objects in React, but I keep encountering a "module not found" error. This issue has been frustrating me for the past couple of days. Can someone please help me troubleshoot this problem or provide some su ...

I'm attempting to switch between different "screens" by utilizing divs with CSS and JavaScript, using the display property to toggle between none and block. Everything seems to be functioning smoothly except for the

I thought I grasped the concept of this because all my toggles are working fine, except for the last one. The frustrating part is that it's written in the same manner as the others before it. The problematic button is identified by id="startYearOne". ...

Tips for implementing SVG in background images on Internet Explorer

Having a similar issue to the one discussed in this thread. My background images are functioning properly on all browsers except for versions lower than IE10. After reading through that post, I created a background image in SVG format specifically for IE10 ...

Leveraging Python Variables in HTML within a multiline Python string

Attempting to create HTML code using Python and run it from a browser. Check out the code below: import webbrowser f = open('image.html','w') message = """<html> <head></head> <body><img src="URL"></b ...

Tips for splitting a word in the uib-typeahead menu

I have successfully implemented a uib-typeahead dropdown in my AngularJS application where I display two attributes. The API is called based on the first name, and the response contains an object with both first name and last name. However, currently, they ...