Increasing the vertical spacing between two grid items is important for maintaining a visually appealing layout

When using a grid layout with 2 columns on devices wider than 768px, there seems to be an increase in spacing between the element and the one following it at that breakpoint.

I'm looking for a solution to adjust the height so that it is dictated by the content within that specific column.

** My development environment includes Tailwind CSS and Next.js.

import React from 'react'
    
function services() { 
  return ( 
    <div>
    
      {/* Carousel component */}
    
      <div className='grid grid-cols-1 md:grid-rows-6 md:grid-cols-2 sm:px-5'>
        
        <div className='flex flex-col px-5 my-10 md:row-start-1 md:col-start-1 md:col-span-1'>
          <h2 className='text-xl mb-4'>Inbound Marketing</h2>
          <p className='text-gray-400'>Through Inbound Marketing, we establish... </p>
        </div>
        
        <div className='flex flex-col px-5 my-10 md:row-start-2 md:col-start-2'>
          <h2 className='text-xl mb-4'>What is Inbound Marketing?</h2>
          <p className='text-gray-400'>Inbound Marketing is...</p>
        </div>
      
        <div className='flex flex-col px-5 my-10 md:row-start-3 md:col-start-1'>
          <h2 className='text-xl mb-4'>How it works:</h2>
          <p className='text-gray-400'>The concept of Inbound Marketing is...</p>
          <p className='text-gray-400'>We aim to present...</p>
        </div>
      
        <div className='flex flex-col px-5 my-5 md:row-start-4 md:col-start-1'>
          <h2 className='text-xl mb-4'>What results do we want to achieve?</h2>
          <p className='text-gray-400'>Inbound Marketing serves...</p>
          <p className='text-gray-400'>We can...</p>
          <p className='text-white my-2'>Increase...</p>
          <p className='text-white my-2'>Decrease...</p>
          <p className='text-white my-2'>Improve...</p>
        </div>
      
        <div className='px-5 my-5 md:row-start-5 md:col-start-1'>
          <video autoPlay loop muted>
            <source src="/social.mp4" type='video/mp4'/>
          </video>
        </div>
        <div className='flex flex-col px-5 my-10 md:row-start-5 md:col-start-2'>
          <h2 className='text-xl mb-4'>Social Ads</h2>
          <p className='text-gray-400'>It's a form of advertising...</p>
        </div>
      
        <div className='flex flex-col px-5 my-10 md:row-start-6 md:col-start-1'>
          <h2 className='text-xl mb-4'>PPC Campaigns</h2>
          <p className='text-gray-400'>We also manage...</p>
          <h2 className='text-xl my-4'>How do we do this...</h2>
          <p className='text-gray-400'><span className='text-white'>Analysis:</span> Study...</p>
          <p className='text-gray-400 mt-2'><span className='text-white'>Analysis... </span>Study and...</p>
          <p className='text-gray-400 mt-2'><span className='text-white'>Proposals...</span> Proposed actions...</p>
          <p className='text-white mt-4'>To carry out...</p>
        </div>
        <div className='px-5 md:row-start-6 md:col-start-2'>
          <video autoPlay loop muted>
            <source src="/analytics.mp4" type="video/mp4" />
          </video>
        </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

Creating an animated transition for an element's height with CSS

I need to animate the height of a div that doesn't have a specified height. Using max-height isn't an option due to multiple potential height amounts. I attempted adding transition: height 0.2s ease to the div, but it didn't work as expecte ...

The `margin:auto;` property does not function properly with inline-block elements

I recently adjusted my "container" div by changing it to an inline-block. Previously, I had applied margin:auto; to center it, which worked well with a specified width. Original Code (functional) #container { border: 1px solid black; height: 2 ...

After selecting an item, the Next UI navbar menu seems to have trouble closing

Having trouble with the navbar menu component not closing when an option is selected from the menu. The menu does open and close successfully within the menu icon. I attempted to use onPress() but it doesn't seem to be working as expected. "use c ...

Improving efficiency for handling a vast number of inputs in React applications

Dealing specifically with Material UI, I am faced with the challenge of rendering a large number of inputs (more than 100) while effectively managing global state. Performance issues arise when using the Material UI <TextField /> component, with noti ...

CSS: Overlapping two divs with unique classes and varying margins - Unexpected occurrence or intentional design?

One thing I'm curious about: Will the margins of two different divs merge if they have the same value when intersecting? It appears so! Do paddings not merge when two different divs intersect, even if they have the same value? It seems that way! When ...

Issue creating a JWT using jsonwebtoken module in Node.js

Could someone help me troubleshoot an issue I'm having while trying to generate a JWT token? The error message "TypeError: Right-hand side of 'instanceof' is not an object" keeps appearing even though the syntax seems correct. const jsonwebt ...

Encountering issues during React spring installation process

I am struggling with a problem while trying to install react-spring in my react project. Every time I attempt to do so, I encounter a slew of dependency errors and warnings that leave me confused and unsure of how to proceed. Despite searching through th ...

Is there a way to implement CSS transitions when hiding elements?

My bootstrap navbar collapses and displays items outside of it. However, when I hide the menu, the overlay div disappears immediately and does not transition smoothly with the menu. How can I apply a transition to the div when hiding the menu? I've t ...

Possible issue with accurate indexing causing caption error with API images in React

Continuing from: Implementing a lightbox feature in react-multi-carousel for my ReactJS app My application utilizes react-images for the lightbox functionality and react-carousel-images for the carousel. The API provides a title and image data. The issue ...

The React component is failing to display updated data from the Redux store

I've been working with React and Redux, trying to update my counter value in the React view. I can successfully log the latest state of my Redux store, but the changes are not reflecting in my React view. const counter = (state = 0, action) => { ...

React form containing multiple child components with access to parent state

I am currently working on a form that consists of a large matrix of checkboxes, totaling in the hundreds, accompanied by one title text input. The rough structure appears as follows: render() { <form> <input type=text>title</in ...

Design and styling with HTML5 and CSS

Having a small issue with my code as I venture back into coding after a long hiatus, resulting in me forgetting some basics. Currently, I am attempting to create a simple HTML layout. Upon inspecting the page, I noticed that it appears slightly longer tha ...

Style condition within an HTML element

Can you apply conditional styling within the <head> tag as demonstrated in the following example? <body> <div id="InScreenAlertContainer" <!--[if IE]> <style>width=100%</style> <![endif]--> > ...

Safari not rendering SVG wave at full width reached

My SVG isn't scaling to 100% width in Safari like it is in IE, Chrome, and Firefox. Despite numerous attempts, I haven't been able to make my SVG stretch across the full width like it does in other browsers. The project is built using React. . ...

Declaration of Character Encoding in CSS3

Do I need to include a character encoding declaration in CSS3? When I add the @charset "utf-8"; declaration, Visual Studio's CSS3 validation displays a warning. Can anyone offer some guidance on this issue? ...

Overlaying images on top of text

Is there a way to overlay an image on text, like a pattern image? Similar to applying color with a hex value in CSS: color: #ffffff; Any ideas on how this can be achieved? I want to have a pattern over text. https://i.sstatic.net/JaNZU.jpg Appreciate ...

Discover the beauty and color of transforming markdown to HTML using Python

Is there a way to convert markdown text into beautiful, colorful HTML using Python? I've tried searching online, but all I can find are results related to the Markdown library. The code snippet provided only generates plain HTML with no color or styli ...

Error in TypeScript: Module 'stytch' and its corresponding type declarations could not be located. (Error code: ts(2307))

I'm currently developing a Next.js application and encountering an issue while attempting to import the 'stytch' module in TypeScript. The problem arises when TypeScript is unable to locate the module or its type declarations, resulting in t ...

Deleting a specific element in React: Step-by-step guide

Having an issue with the handleDelete() method in DisplayList.JSX where it is deleting the first element instead of the selected element. How can this be resolved? Github Display.jsx import {DisplayList} from './DisplayList'; class Display e ...

What is the best way to apply a box-shadow to a specific side of an element?

How can I apply a box shadow to only the right side of a block element? Currently, I achieve this by wrapping the inner element with a box-shadow in an outer element with padding-right and overflow:hidden to hide the other three sides of the shadow. Is the ...