The alignment of grid items is slightly askew

I've been having an issue where when I maximize the browser window, everything on my website looks fine except for the cards in the packages section. They aren't centering properly. Any ideas on what might be causing this?

Check out the website here

/* Packages */

.packages {
  background-color: #F3F1F6;
  text-align: center;
  font-family: 'Roboto', sans-serif;
  padding: 50px 0;
}

.packages-title h4 {
  font-weight: 300;
  opacity: 50%;
}

.packages-title h2 {
  font-size: 2em;
}

.packages-cards h1 {
  font-family: 'Lato';
  font-size: 4em;
  padding: 10px 0 20px;
}

.packages-cards div {
  background-color: #fff;
  margin: 50px auto;
  padding: 50px 0;
  max-width: 350px;
  -webkit-box-shadow: 0px 0px 15px 2px rgba(0, 0, 0, 0.15);
  box-shadow: 0px 0px 15px 2px rgba(0, 0, 0, 0.15);
}

.packages-cards h4 {
  font-weight: 300;
  opacity: 50%;
}

.packages-cards p {
  font-weight: 300;
  opacity: 50%;
  line-height: 2;
  padding-bottom: 20px;
}

@media(min-width: 996px) {
  .container {
    margin: 0 10%;
  }
  .showcase {
    background-image: url('imgs/cityline.jpg');
  }
  .showcase-content h1 {
    font-size: 2.5em;
  }
  .showcase-content p {
    margin: 20px 0 45px 0;
  }
  .about-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 60px;
  }
  .about-cards div {
    max-width: 300px;
  }
  .packages-cards {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-gap: 30px;
  }
  .packages-cards div {
    margin: 50px 0;
    max-width: 300px;
  }
  .sign-up {
    background-image: url('imgs/signup-1200.jpg');
  }
}
<section class="packages">
  <div class="packages-title">
    <h4>A plan for everyone</h4>
    <h2>Plans &amp; Pricing</h2>
  </div>
  <div class="container">
    <div class="packages-cards">
      <div class="basic">
        <h4>Basic Plan</h4>
        <h1>$49</h1>
        <p>
          Up to 1000 Mbps up &amp; down <br> Lowest ping times <br> No setup fees <br> No data cap <br> No contract <br> 24/7 support
        </p>
        <button class="btn">Sign Up</button>
      </div>
      <div class="plus">
        <h4>Plus Plan</h4>
        <h1>$79</h1>
        <p>
          Up to 1000 Mbps up &amp; down <br> Lowest ping times <br> No setup fees <br> No data cap <br> No contract <br> 24/7 support
        </p>
        <button class="btn">Sign Up</button>
      </div>
      <div class="pro">
        <h4>Pro Plan</h4>
        <h1>$99</h1>
        <p>
          Up to 1000 Mbps up &amp; down <br> Lowest ping times <br> No setup fees <br> No data cap <br> No contract <br> 24/7 support
        </p>
        <button class="btn">Sign Up</button>
      </div>
    </div>
  </div>
</section>

Answer №1

Include the following snippet in your script:

.features-container {
    align-items: center;
}

.features-container div {
    margin-top: 30px;
}

Answer №2

This section is causing the alignment to shift left (centering appears broken).

@media(min-width: 996px) {
  .packages-cards div {
    margin: 50px 0;
    max-width: 300px;
  }
}

To center the block, modify it as follows:

@media(min-width: 996px) {
  .packages-cards div {
    margin: 50px auto;
    max-width: 300px;
  }
}

You can also include width: 100%; or min-width: 230px; based on your preference.

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

Code for activating datalist on Safari and Opera browsers

As I was wrapping up work on a website, I realized that Safari doesn't support the datalist feature in HTML. This was quite troublesome since a significant portion of the site's audience consists of individuals who may not be very tech-savvy, mak ...

Encountering issues initializing JavaScript while utilizing React.JS alongside Materialize version 1.0.0

Struggling to migrate our projects from materialize-css v1.0 to react.js using npm. Has anyone else faced this challenge and found any solutions? I can easily use the css portion by referencing the npm module in Index.js. The issue arises when trying to ...

What is the best way to transfer weather data from a server to an HTML text area box?

Recently, I delved into the world of expressJS to set up a local server (localhost:3000). With the power of JavaScript (specifically in a file named app.js), I was able to send simple messages like "Hello World" to the browser. However, now I find myself f ...

Price Table with Unique CSS3 Design Shapes

I'm currently working on designing a price table that resembles a bone shape. I stumbled upon some code on CodePen that could help me achieve this look, but I'm unsure of how to tweak and merge it. I'm facing difficulties when it comes to s ...

Complete visibility of Bootstrap progress labels is compromised

Progress bar with a customized label inside: <div id="progress" class="progress mb-1" style="height: 20px;"> <div class="progress-bar" role="progressbar" style="width: 5.0%" aria-valu ...

Creating a personalized data filtering system for tables in Angular 6

I recently wanted to enhance my Angular code with a custom table filter. After conducting a web search, I stumbled upon this informative blog post: The implementation worked quite effectively and here is the snippet of the pipe code: import { Pipe, PipeT ...

Minimizing the gap between icon and label text

I have a React form that I need help with. The issue is that I want to reduce the space between the list icon and the label. Here is the CSS I am using: .form__container { display: flex; flex-wrap: wrap; } .form__container input { color: rgb(115, 0, ...

How can I use htaccess to forward all links within a specific folder to index.php with a GET variable attached?

Is it possible to redirect all links inside a folder to index.php while passing the file name as a GET variable? I have never worked with htaccess before and don't know how to search for it. For instance: localhost/folder/file-123 should redirect to ...

Is it possible to trim a video using HTML code?

I am trying to find a way to crop a video using HTML 5. <video id="glass" width="640" height="360" autoplay> <source src="invisible-glass-fill.mp4" type="video/mp4"> </video> Currently, the video has a resolution of 640x360. However ...

Tips for adjusting the font size according to the varying number of characters entered

I am currently facing a challenge with adjusting the font size based on the dynamic number of characters. For example, I have a set of characters with a font-size of 40px, and as more characters are added, the font size should decrease to fit within the av ...

What is the best way to vertically and horizontally center an element?

Is it possible to center an object in the middle of the screen using margin: 0 auto, but how can you center it vertically too? Additionally, is there a way to make the border in h2 surround only the text and not the whole width? html body { p ...

Using cell in a React table

I am in the process of developing a basic table in React with three columns labeled WO, PID, VS. For each cell within these columns, I will need to input data accordingly. The code snippet below showcases my initial implementation along with the desired ou ...

The pseudo right arrow is failing to display in the vertical center

My pseudo right arrow is not displaying vertically centered within the .nav-link class. Can anyone suggest how I can achieve vertical alignment for my right arrow in an <a> tag? I have already attempted using top:50% but it did not work. Here is th ...

use a loop to add various html meta tags to the header section

In the midst of developing a Shopware plugin, my focus is on adding meta data to the html tag head. Utilizing twig, I extend a template and incorporate code into it. By triggering an event, I pass an array of meta entities mykn_metaFields to my twig templa ...

What is the proper way to implement a divider in HTML5?

Looking for advice on how to effectively use dividers positioned at the center of a page? Specifically, I am interested in having two dividers: one measuring 200px wide and another measuring 500px wide, both with a 5px top margin. These dividers should be ...

Assign a new class to the child element of **this**

Can you please explain how to apply a class to the child elements of this? I am looking to give a different background color to all Compliant items. For example: <div class="tab"> <tr><td class="compliance">Compliant</td>< ...

The Vertical Navigation Bar with Bootstrap 4.1: A Unique Twist on Album Showcase

I'm currently utilizing the 'Album' example from Bootstrap 4.1 but struggling to display additional nav-items horizontally. https://i.sstatic.net/omeRC.png When I tried adding 'navbar-expand-lg', it arranged everything in a horiz ...

Encountering a problem with displaying error messages in an empty text field

I am facing an issue with displaying error messages when a text field is left blank. I would like a simple message, such as "can't be empty", to appear below the text field in red color when the user clicks the submit button and leaves multiple fields ...

Having trouble changing a CSS property (margin-right)?

I have created a simple HTML list that consists of various items: <div id="menu"> <ul> <li>apples</li> <li>&#149</li> <li>bananas</li> <li>oranges</li> <li>grape ...

Display a div when hovering over it, with its position set from the bottom of the main

I am attempting to use CSS to display another div within my main div, but positioned from the bottom of the main div rather than as a block as I am currently testing with my code. HTML <div id="main"> <a href="#"><img src="https://www.g ...