Is there a way to create space at the bottom after setting margin to auto?

I'm currently mastering Bootstrap v5.0 and experimenting with creating a webpage using Bootstrap. I've encountered an issue that requires assistance. Specifically, I'm trying to add extra space between two columns on smaller screens while maintaining the design for larger screens.

I need guidance on the Education section of my code.

* {
                /* margin: 0;
                padding: 0;
                box-sizing: border-box; */
                font-family: 'Open Sans', sans-serif;
                color: #ffffff;
            }
            /* ==================== Header ==================== */
            header {
                background: #9b59b6;
            }
            .header-title-box {
                background: #8e44ad;
            }
            /* ==================== About Container ==================== */
            .about-container {
                background: #2ecc71;
            }
            /* ==================== Education Container ==================== */
            .education-container {
                background: #34e7e4;
            }

            /* Additional CSS rules...
            
<!DOCTYPE html>
            <html lang="en">
            ...
            </html>

Here are the images:

The layout is fine on big screens https://i.sstatic.net/RkauU.png

But I require some spacing on small screens here: https://i.sstatic.net/vIcf9.png

Any suggestions on how to achieve this?

Answer №1

Furthermore, the calc function can be utilized within the style attribute to adjust values dynamically, for example margin-bottom:calc(20vh - 10%)

Answer №2

To achieve the desired effect, simply use mx-auto my-5

                <div class="col-md-4 d-flex align-items-center justify-content-center  my-5 mx-auto" style="border-radius: 50%; background-color: #3c40c6; height: 200px; width: 200px;">
                    <p class="display-6">BSc</p>
                </div>

Answer №3

simply include a bootstrap class

<div class="col-md-8 card m-auto my-5" style="background: #3c40c6">
        <div class="card-body">
          <h5 class="card-title">Agricultural University College</h5>
          <hr />
          <h6 class="card-subtitle mb-5">2016 - 2018</h6>
          <p>
            Lorem ipsum dolor, sit amet consectetur adipisicing elit.
            Exercitationem non recusandae architecto dolores atque est,
            quisquam minus tempora, libero soluta distinctio, natus nostrum
            veniam reprehenderit neque unde totam! Suscipit dolor harum
            vero, quas ea iusto in cumque mollitia doloremque ad ipsam ab
            repudiandae autem debitis soluta molestias nostrum neque
            corrupti!
          </p>
        </div>
      </div>

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

Troubleshooting issue with AngularJS $http.get function failing to show retrieved

My data is showing up when I call the URL from dataSource, but it's not displaying when I use $http.get. I am sending this data to a dx-chart using a JsonResult from my controller. Below is the code snippet that includes my AngularJS file and MVC View ...

Using a variable with the :contains selector

function checkAndUpdateStatus(newName) { $('#myTable').children('tr').remove(":contains('" + newName + "')"); }; The function above is attempting to remove table rows in 'myTable' containing a string matching the ...

SmartCollection in Meteor generating unpredictable outcomes

When executing News.insert({name: 'Test'}) in the browser JS console, it caused {{count}} to increase from 0 to 1. Checking in mongo console using mrt mongo, db.news.find().count() also returns 1. However, after adding a record through the mongo ...

Variations in spacing due to line breaks

Looking for a solution to my code formatting issue in HTML. Here is an example of my CSS: span{height:200px;width:200px;border-width:1px;border-color:black;border-style:solid;display:inline-block} This is how my HTML code looks before changes: <span& ...

Tips for showcasing HTML code retrieved from a fetch request in a Vue component

Trying to integrate HTML code received from an API into my VueJS code. The API provides the following: <p>blah blah blah</p> <ul> <li> 1 </li> <li> 2 </li> </ul> Saving this code snippet into a variable, but ...

Passport sessions do not retain persistence

Having some trouble implementing OAuth 2.0 login where the sessions don't persist after authentication is a common issue. Additionally, there seems to be a problem with the app getting stuck in the routes/bnetauth.js file during the redirect in the ca ...

Ways to target only the adjacent div

My goal is to target only the next div with the class name indented. Each indented div should have the same id as the <li> element right before it. Currently, I want each div with the class name indented to have the id of the previous <li>. He ...

Alter the border color of a bootstrap-div using JavaScript

I need to update the border color of a div element, but I'm encountering issues when using a bootstrap class on the div. Is there a way to change the border color using Javascript? <link href="https://cdn.jsdelivr.net/npm/<a href="/cdn-cgi/ ...

Error: Uncaught [🍍]: The function "getActivePinia()" was invoked without an active Pinia instance present. Ensure that you have called "app.use(pinia)" before attempting to utilize a store

I encountered an issue while trying to access a store in Pinia for my Vue web application. Despite installing Pinia and setting app.use(createPinia()), I keep receiving the following error message: Uncaught Error: [ ...

How to Accurately Obtain Serial Numbers in Add, Remove, and Clone Operations Using My Calculation Method

How To Properly Calculate SrNo in the Add, Remove, and Clone Functions By clicking "Add" multiple times, deleting rows, and then adding again, the SrNo becomes incorrect. I want it to calculate properly with my custom function... <div id="button_pro" ...

The attempted JavaScript socket emissions from the server to the client for listening are currently experiencing difficulties and

I have encountered a peculiar issue with my code. It involves emitting from the server side and listening on the client side. The connection seems to persist indefinitely, even when the client refreshes or exits the page. However, the code on the client si ...

Tips for adding elements to a computed property in Vue

I've been working on implementing an infinite scroll feature in a Vue3 app. While everything is functioning well, I've hit a roadblock when it comes to loading more data once the user reaches the end of the page. All profiles are initially store ...

place another ionic3 button adjacent to the existing one

I was looking to position a button next to another one, rather than below it <ion-row> <span *ngIf="dado.status == 0" style="margin-left: 50%"> Pending </span> ...

navigating directly to a particular slide within a Bootstrap carousel on a different page by clicking

Attempting to set up a bootstrap build, where clicking on certain states on one page will direct the user to a specific slide on another page. I'm struggling to grasp this concept. A friend of mine, who is a Javascript developer, provided some code f ...

Position 2 identical classes side by side on the horizontal axis

Currently enrolled in the MIMO HTML course and facing a challenge where I am unable to align both elements with the class="column" attribute horizontally using display: inline-block; I have attempted using float:right and other CSS properties to achieve a ...

Issue: The function `this.isModified` is not recognized as a valid function

Encountering an unusual problem. This code snippet is causing an error and it relies on arrow functions UserSchema.pre('save', next => { const SALT_FACTOR = 5; if (!this.isModified('password')) return next(); bcrypt.genSalt ...

Utilizing jQuery to Maintain State Across Page Refreshes with Cookies

Currently, I am attempting to create a script that can retain its state even after the page is refreshed. Here is my progress so far: Utilizing jQuery: $(window).ready(function() { var voteId = $('.gallery-item a'); $(voteId).click(function() ...

Creating secure RSA keys using a predetermined seed - a step-by-step guide

Is it possible to utilize a unique set of words as a seed in order to recover a lost private key, similar to how cryptocurrency wallets function? This method can be particularly beneficial for end-to-end encryption among clients, where keys are generated o ...

What is the best way to ensure that all my table images are uniform in size?

Despite creating a table with images all sized 150x150px, I am encountering some inconsistencies where certain images appear larger or smaller than others. Interestingly, when I input the code into JSFiddle, everything appears to be working properly. Howe ...

One way to submit a value form in an iframe is by double clicking

I am looking to submit a value form in a frame that functions as described below: index.php <form action="iframe1.php" method="post" target="iframe1"> <input type="text" name="lala"> <input type="submit"> </form> <iframe name= ...