When viewing my website on larger screens, the CSS and Bootstrap 5 styling ensure a responsive design. However

I've been working on creating a webpage using Bootstrap 5, and I've managed to make it responsive for mobile devices using @media queries. However, I'm facing an issue where some of the divs, sections, and rows are not aligning properly when viewed on larger screens. How can I ensure that the columns are centered regardless of the screen size?

Everything looks perfect on my resolution view image here

but when I zoom out, it shifts to the left view image here

HTML

<div class="container">
<div class="card">
 <div class="row">
   <div class="col-12 col-md-8">
 <div class="circle"> </div>
 <div class="col-6 col-md-4"></div>
 <h1>TOKEN</h1>
</div>
 <div class="content1">
 <p>The token will be launched in phase 2, which will serve as a passive reward for each of our DIVERS and as a token for the metaverse economy that is being built for the third phase.</p>
</div>
 <img src="http://luxtopia.org/wp-content/uploads/2022/02/haseowo.gif">
</div>
</div>
</div>
</div>

CSS

  * {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    scroll-behavior: smooth;
...

Thank you to everyone who took the time to read my post, I appreciate any help :')

Answer №1

  1. There is a small error in the first <div> class name (contaier should be container).

  2. To center your elements, consider adding these flex attributes:

    .card{

     justify-content: center;
    

    }

Alternatively, you can also utilize bootstrap classes like this:

<div class="card justify-content-center"></div>

This will center the child elements of the card. If you are having issues with column alignment, try adding the bootstrap class to the respective div:

<div class="row justify-content-center">

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

Get rid of the underlined anchors in your email signature

I'm currently in the process of creating personalized email signatures for one of my clients. At this point, I am testing them on various platforms such as GMail, Hotmail, Brinkster, and more. One issue I am facing is trying to remove the underline t ...

The functionality of .bind() is malfunctioning on both Microsoft Edge and Google Chrome browsers

Everything seems to be running smoothly on Mozilla (version 103.0), but unfortunately, it's not performing as expected on Chrome or Microsoft Edge. $('#loading').bind('ajaxStart', function () { $(this).show(); }).bind('ajaxS ...

Guide to positioning an image at the center in jqm with the help of the Mosaic plugin

Recently, I started using JQuery mobile to create a mobile website for a local restaurant. To add captions to the images in the menu, I found and utilized the Mosaic JQuery plugin successfully. However, I encountered an issue with the alignment of images o ...

Display the contents in a textarea with modal, not as a string

I'm currently working on implementing a modal overlay window with simplemodal that will display the contents of a text area. My goal is to show the rendered output rather than just the string value. For example, if a user enters HTML or includes an im ...

Attach an event listener to a particular textarea element

Currently, I am developing a project in Next.js13 and my focus is on creating a custom textarea component. The goal is to have this component add an event listener to itself for auto-adjusting its height as the user types. Below is the relevant section of ...

Dealing with Sideways Overflow Using slideDown() and slideUp()

Attempting to use slideUp() and slideDown() for an animated reveal of page elements, I encountered difficulty when dealing with a relatively positioned icon placed outside the element. During these animations, overflow is set to hidden, resulting in my ico ...

Using AngularJS to link the ng-model and name attribute for a form input

Currently, I am in the process of implementing a form using AngularJS. However, I have encountered an issue that is puzzling me and I cannot seem to figure out why it is happening. The problem at hand is: Whenever I use the same ngModel name as the name ...

The image is not appearing on the webpage even though the online URLs are functioning correctly

I am currently facing an issue with my Django portfolio website where I cannot get my photo to display even though the path is correct. However, online images are displaying properly on the site. <html lang="en"><head><link href="https: ...

Difficulties arise when attempting to display an input within a Bootstrap modal

Upon clicking an icon, I aim to display a bootstrap modal prompting the user to input text and a date. I have adapted code from W3Schools to create the necessary form. Unfortunately, when the button is clicked, only the labels and text area are shown, not ...

Implementing Angular JS to Fill a Drop-down Menu with JSON Data

Here is my HTML code: <body ng-app="mainApp"> <div ng-controller="myController"> <select> <option ng-repeat="person in persons">{{ person.data }}</option> </select> </div> </body> This is my JavaScript ...

It vanishes as soon as you move your cursor away during the animation

I created a button component with text animation, but I'm encountering an issue. When I hover over the button, the animation works smoothly. However, if I quickly move my cursor away or unhover in the middle of the animation, the text disappears unex ...

Resizable item within a text box (similar to an HTML editing tool)

After extensive searching online, I have not been able to find a solution. What I need is a draggable input element within a textarea in a text-editable div. The draggable textarea should be integrated seamlessly into the text, and upon submitting, it shou ...

After a group of floated items, there will be an automatic "clear: both" applied

Within my Content Management System, I have custom Elements that need to be floated next to each other. Instead of adding an extra div with a class of "clear", I want to automatically insert a clear: both at the end using CSS3. I attempted this workaround ...

Highlight react-bootstrap NavItems with a underline on scroll in React

I am currently working on a website where I have implemented a react-bootstrap navbar with several Nav items. My goal is to enable smooth scrolling through the page, where each section corresponds to an underlined NavItem in the navbar or when clicked, aut ...

Disabling the submit button prevents the form from being submitted

After coming across this code designed to prevent double submission of a form, I noticed that it is not functioning correctly. Despite disabling the submit button and changing its value to "Please wait", the form is still being submitted. <input type=" ...

Is it possible to conceal my Sticky Div in MUI5 once I've scrolled to the bottom of the parent div?

Sample link to see the demonstration: https://stackblitz.com/edit/react-5xt9r5?file=demo.tsx I am looking for a way to conceal a fixed div once I reach the bottom of its parent container while scrolling down. Below is a snippet illustrating how I struct ...

Tips on arranging text around an image to prevent any overlapping

CLICK HERE FOR THE ISSUE This is the outcome. I prefer the text to be separate from the image. ...

How can you use CSS to style an image's title attribute?

I am trying to customize the text displayed when hovering over an image. Despite my efforts, the code I used doesn't seem to be working properly: <body> <img src="img.jpg" title="<span class='title'>title</span>" &g ...

I am struggling to activate the hovering feature on my menu bar

I am having trouble making the hover effect in my navigation bar work properly. Even though I can separately make the 'display: none' and hover effects work, they do not function together. I am unsure of what mistake I might be making. Below is ...

Issue with loading a stylesheet from a GitHub raw URL

How are you feeling today? I appreciate your willingness to assist, although I realize this may seem like a trivial question. I am struggling to comprehend why things are not functioning as expected. Within my local directory, I have the following tree s ...