What is the best way to adjust padding within a flexbox layout?

I am attempting to replicate the design of this webpage using HTML and CSS: https://i.sstatic.net/bFVmg.jpg

But, I am struggling to adjust the padding for the box on the right side. Here is how my version looks currently: https://i.sstatic.net/WMwii.jpg

How can I modify the CSS to eliminate the large white gap at the top of the text? Below is the code I have implemented:

 .flexbox {
      margin: 1rem 6rem;
      display: flex;
      justify-content: center;
      align-items: center;
      font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, 'Helvetica Neue', Arial, sans-serif;
      /* background-color: grey; */
    }
    
    .ten {
      height: 100%;
      text-align: center;
      flex-basis: 40%;
      font-size: 25vw;
      letter-spacing: -3rem;
    }

    .yrs-exp {
      min-height: 100%;
      display: flex;
      flex-direction: column;
      flex-basis: 18%;
    }

    .yrs-exp p {
      margin-bottom: 2rem;
    }

    .yrs-exp button {
      text-transform: capitalize;
      height: 7vh;
      width: 80%;
    }

    .deats {
      display: flex;
      min-height: 100%;
      flex-basis: 30%;
      justify-content: center;
      align-items: center;
      text-align: center;
      flex-wrap: wrap;
    }

    .deat {
      display: flex;
      align-items: center;
      flex-direction: column;
      flex-basis: 49%;

      border: solid 1px black;
    }

    .deat h2 {
      font-size: 6vw;
      margin-bottom: -0.8rem;
    }
    .deat p {
      text-transform: uppercase;
      margin-top: 0;
    }
<div class="flexbox">
      <div class="ten">10</div>
      <div class="yrs-exp">
        <h1>Years of experience</h1>
        <p>
          DreamSoft is a team of highly experienced app designers and developers
          creating unique software for you.
        </p>
        <button>GET IN TOUCH</button>
      </div>
      <div class="deats">
        <div class="deat">
          <h2>2k</h2>
          <p>Apps developed</p>
        </div>
        <div class="deat">
          <h2>40</h2>
          <p>Consultants</p>
        </div>
        <div class="deat">
          <h2>12</h2>
          <p>Awards</p>
        </div>

        <div class="deat">
          <h2>160</h2>
          <p>Employees</p>
        </div>
      </div>
    </div>

For reference, here is the codepen link: https://codepen.io/caseycling/pen/yLVdzja

Answer №1

I decided to make some additional tweaks:

.flexbox {
      margin: 1rem 6rem;
      display: flex;
      justify-content: center;
      align-items: center;
      font-family: 'Poppins', -apple-system, BlinkMacSystemFont, 'Segoe UI',
        Roboto, 'Helvetica Neue', Arial, sans-serif;
      /* background-color: grey; */
    }

    /* .flexbox > div {
      background-color: rgb(206, 89, 89);
    } */

    .ten {
      height: 100%;
      text-align: center;
      flex-basis: 40%;
      font-size: 25vw;
      letter-spacing: -3rem;
    }

    .yrs-exp {
      min-height: 100%;
      display: flex;
      flex-direction: column;
      flex-basis: 18%;
    }

    .yrs-exp p {
      margin-bottom: 2rem;
    }

    .yrs-exp button {
      text-transform: capitalize;
      height: 7vh;
      width: 80%;
    }

    .deats {
      display: flex;
      min-height: 100%;
      flex-basis: 30%;
      justify-content: center;
      align-items: center;
      text-align: center;
      flex-wrap: wrap;
    }

    .deat {
      display: flex;
      align-items: center;
      flex-direction: column;
      justify-content: center;
      flex-basis: 49%;
      height: 150px;
      border: solid 1px black;
    }

    .deat h2 {
      font-size: 6vw;
      margin: 0;
    }
    .deat p {
      text-transform: uppercase;
      margin-top: 0;
    }

    .clients {
      display: flex;
      margin: 1rem 6rem;
      justify-content: space-around;
    }

    .clients img {
      opacity: 0.5;
      border: solid 1px rgba(0, 0, 0, 0.5);
    }

    .clients img:hover {
      opacity: 1;
      border: solid 1px rgb(0, 0, 0);
    }
<div class="flexbox">
      <div class="ten">10</div>
      <div class="yrs-exp">
        <h1>Years of experience</h1>
        <p>
          DreamSoft is a team of highly experienced app designers and developers
          creating unique software for you.
        </p>
        <button>GET IN TOUCH</button>
      </div>
      <div class="deats">
        <div class="deat">
          <h2>2k</h2>
          <p>Apps developed</p>
        </div>
        <div class="deat">
          <h2>40</h2>
          <p>Consultants</p>
        </div>
        <div class="deat">
          <h2>12</h2>
          <p>Awards</p>
        </div>

        <div class="deat">
          <h2>160</h2>
          <p>Employees</p>
        </div>
      </div>
    </div>

    <div class="clients">
      <a id="client"
        ><img
          src="https://ld-wt73.template-help.com/wt_prod-18959/images/clients-9-270x117.png"
          alt="mittos"
      /></a>
      <a
        ><img
          src="https://ld-wt73.template-help.com/wt_prod-18959/images/clients-10-270x117.png"
          alt="mittos"
      /></a>
      <a
        ><img
          src="https://ld-wt73.template-help.com/wt_prod-18959/images/clients-3-270x117.png"
          alt="mittos"
      /></a>
      <a
        ><img
          src="https://ld-wt73.template-help.com/wt_prod-18959/images/clients-11-270x117.png"
          alt="mittos"
      /></a>
    </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

Struggling to effectively customize a bootstrap theme

After incorporating a custom .css file from an internet theme that overrides some bootstrap properties, I noticed that it works in certain scenarios. However, when attempting to modify the primary color in the :root{} section of the styles.css file, the ch ...

Present two logos on either side of a navigation bar with Bootstrap in between

I am facing an issue with the display of my two logos. One logo is supposed to be in the right corner and the other in the left, but the right logo is not appearing correctly. <header class="navbar navbar-inverse navbar-fixed-top bs-docs-nav" role="ban ...

Align text vertically within a link box by overriding inherited CSS styles

Fiddle: http://jsfiddle.net/jgallaway81/ax9wh/ <a href="lcars.jfx.php" class="leftbuttons buttonlinks antibutton"> LCARS Locomotive O.S. </a> My issue pertains to the alignment of text within a graphic. I am utilizing this particular button ...

Instructions for accessing and printing text from a nested ul tag with Selenium in Java

Hello everyone, I am currently learning about Selenium Automation and have created a website as shown below. Here is the HTML code: <!DOCTYPE html> <html> <head><title>Shop</title></head> <body> <ul> < ...

photos arranged in rows rather than a single row

Looking for help with arranging the remaining photos in the second row? Check out this example image link. I'm struggling to organize a row of overflow images within the "small-img-row" division. This row is located under the main image in col-2. H ...

Locate numbers 2, 3, 6, 7, and 10, and continue in numerical order, within the

Having trouble with this one. Does anyone know how to display the items like this: 2, 3, 6, 7, 10 and so on... Is there a jQuery or CSS hack that can achieve this? I'm stuck trying to figure it out .container { display: flex; flex-flow: row wra ...

Designing a Dynamic Floating Element that Shifts with Scroll Movement

Hey there everyone!, I am currently working on a project in Wordpress and I was wondering if anyone has experience creating a floating widget that moves along with the page as you scroll. Any suggestions on how to achieve this? Would it involve using Javas ...

Choosing pseudo-elements with CSS styling rules

I have been utilizing the Brave browser to block online ads. However, certain websites have found a way to insert ads into their HTML on the server-side, bypassing my ad-blocking efforts in Brave. Currently, Brave only offers the ability to block elements ...

Using multiple background images in CSS on mobile devices

I decided to experiment with creating a grid pattern using css background-images in this way: .grid { width:720px; height:720px; background-color: #333333; background-image: linear-gradient(rgba(255,255,255,0.1), 1px, transparent 1px), ...

Images in gallery slider are excessively large

Hello, this is my very first post on stackoverflow. Please forgive any atypical elements in this post. I have a Django Website with a gallery slider, but I am facing an issue where the images appear way too big. You can view them here: I have dedicated n ...

Troubleshoot: Dropdown menu in Materialize not functioning (menu fails to drop down

I am currently incorporating Materialize to create a dropdown button in my navigation bar. However, I am facing an issue where nothing happens when the button is clicked. Here is a snippet of my code: <head> <meta charset="UTF-8"> <!-- ...

Discovering the technique to dynamically load various content using jQuery in a div based on its

After discovering this code to extract information from the first div with an id of container (box4) and retrieve any new data from the URL, everything was functioning correctly. However, I encountered an issue when attempting to load box5 and rerun the co ...

Struggling with getting the local slick slider to run smoothly

After installing the slick slider plugin and trying out some basic examples on jsfiddle, I encountered an issue when running it locally. For some reason, the results I get when testing it on my local environment are different from what I see on jsfiddle. ...

The modal window does not display a scroll bar

I'm currently facing an issue where the scroll bar is not appearing on my page when more elements are added. In addition, I have a modal that covers the entire page when clicking on an item. However, changing the CSS position: fixed property affects ...

Select the small image to reveal the larger overlay image

I have a grid of images and I want each image to expand into fullscreen when clicked. However, the JavaScript I am using is causing only the last image in the grid to overlay. How can I resolve this issue? Here is the code I am currently using: http://js ...

Responsive design parameters

After creating a media query specifically for phones, I realized that I needed one for desktop as well. @media screen and (max-device-width: 480px), screen and (max-width: 480px) { ...css here... body {width:50%;} However, when I attempted to add a sim ...

Transform your CSS styles into Material-UI makestyles

I am looking to implement an IconButton with a website preview feature that appears when the user hovers over the help icon. I came across a similar solution using CSS, but I need to convert it to Material UI. Here is the CSS code that needs to be converte ...

The absence of FontAwesome Icons is apparent

In the <head> section of my code, I include the following: <script href="https://kit.fontawesome.com/a076d05399.js"></script> Within some of my buttons, I have the following code: <div class="scroll-up-btn"> ...

Custom HTML form created by Ryan Fait with additional unique elements

My current script for styling checkboxes and radiobuttons is working perfectly: The issue arises when I dynamically add checkboxes and radiobuttons to the page using jQuery. The new elements do not inherit the custom styling. Is there a workaround for th ...

An interesting quirk within CSS is that when a field is hidden, it can

I am currently developing a Chrome extension to modify certain text fields, but I have run into an issue. Specifically, I need to hide the "Stato" field so I implemented the following CSS code: https://i.stack.imgur.com/9blvz.png https://i.stack.imgur. ...