What's the best way to reduce the dimensions of this container in order to align them next to one another?

https://i.sstatic.net/VHahe.jpg

As a novice student in the world of coding with html and css, I have embarked on a project to create a website. However, I've encountered a minor issue...

I'm looking to adjust the width of these boxes so they align neatly next to each other rather than appearing misaligned. Any suggestions or solutions? Here's the code snippet:

.superbutton{
  opacity: 100;
  display: flex;
  padding: 10px 30px;
  color: #294f65;
  background-color: transparent;
  border: 2px solid #294f65;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: .1rem;
  transition: .6s ease background-color;
  z-index: +99;
  transition: .5s;
  margin-bottom: 40px;
  margin-top: 1px;
  transform: translate(0,0%);
  position: relative;
  text-decoration: none;
}

.superbutton:hover{
  color: white;
  background-color: #294f65;
  padding: 15px 35px;
  transition: 0.5s;
}

.super{
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 50px;
  justify-content: flex-start;
}

.superbutton:active{
  color: white;
  background-color: #294f65;
  padding: 12px 32px;
  transition: 0.1s;
}
#tickets {
  flex-direction: column;
  text-align: center;
  max-width: 1500px;
  margin: 0 auto;
  padding: 20px 0;
}

#ticketstop .sectiontitle h1{
  font-size: 2rem;
  font-weight: 300;
  color: black;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .2rem;
  text-align: center;
  opacity: 100;

}
.sectiontitle span{
  color: #347f7d;
}

#tickets .sectiontitle{
  font-size: 2rem;
  font-weight: 300;
  color: white;
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: .2rem;
  text-align: center;
  opacity: 100;

}

#tickets .sectiontitle span{
  color: #347f7d;
}

#tickets p {
  text-align: justify;
}

#tickets .ticketsbottom{
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 10px;
  transform: translate(0,-30%);
}

#tickets .ticketsitem {

  flex-basis: 15%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  padding: 10px;
  border-radius: 10px;
  background-image: url(./ticket.jpg);
  background-size: cover;
  margin: 5px 1%;
  position: relative;
  z-index: +1;
  transition: .2s;

}

#tickets .ticketsitem::after{
  content: '';
  position: absolute;
  left:0;
  top: 0;
  height: 100%;
  width: 100%;
  background-image: linear-gradient(60deg, #26323c 0%, #485563 100%);
  opacity: .8;
  z-index: -1;
  border-radius: 10px;

}

#tickets .ticketsbottom .icon{
  height: 80px;
  width: 20px;
  margin-bottom: 25px;
}

#tickets .ticketsbottom .icon img{
  margin-left: auto;
  margin-right: auto;
  transform: translate(-50%,-70%);
  width: 350px;
  position: absolute;

}

#tickets .ticketsitem h2{
  font-size: 2rem;
  color: white;
  margin-bottom: 10px;
  text-transform: uppercase;
}

#tickets .ticketsitem p{
  color: white;
  text-align: left;
  font-size: 1.4rem;
  line-height: 1.9rem;
  white-space: nowrap;

}

#tickets .ticketsitem:hover{
  position: relative;
  padding: 20px;
  transition: 0.2s;
}

/* END TICKETS Section */

/*above tickets*/
.abovepic{
  text-align: center;
  transform: translate(0,-35%);
}
/*below tickets*/
<section id="tickets">
  <div id="tickets container">


    <div class="ticketsbottom">
      <div class="ticketsitem">
        <div class="icon">
          <img src="helios.png"/>
        </div>
        <h2>HELIOS</h2>
        <p>- RTX 3090<br>- i9 11900KF 3.5GHz<br>- 32GB Corsair Memory<br>- Samsung 2TB SSD OS Drive</p>
        <a href="#music" type="button" class="superbutton" target="_blank">BUY NOW</a>
      </div>
      <div class="ticketsitem">
        <div class="icon">
          <img src="hot1.png"/>
        </div>
        <h2>COAL</h2>
        <p>- RTX 3090<br>- i9 11900KF 3.5GHz<br>- 32GB Corsair Memory<br>- Samsung 2TB SSD OS Drive</p>
        <a href="#music" type="button" class="superbutton" target="_blank">BUY NOW</a>
      </div>
      <div class="ticketsitem">
        <div class="icon">
          <img src="remix.png"/>
        </div>
        <h2>REMIX</h2>
        <p>- RTX 3090<br>- i9 11900KF 3.5GHz<br>- 32GB Corsair Memory<br>- Samsung 2TB SSD OS Drive</p>
        <a href="#music" type="button" class="superbutton" target="_blank">BUY NOW</a>
      </div>
    </div>
  </div>
</section>

Answer №1

Check out this piece of code:


.superbutton{
    flex-wrap: wrap; // <---add to end
}
* {
    padding:0;
    margin:0;
    box-sizing: border-box;
}

It is advisable not to use the plus sign in z-index: +99

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

Tips for changing the size of a div using an absolute div position

Is it possible for the #parent div to resize based on the dimensions of the #child div (if the #child div is using position:absolute;)? Similar to how the #t_parent table resizes according to the size of the #t_child table. <div id="parent" style="pos ...

Conceal the block quotes while substituting with a newline

My HTML page contains numerous comments enclosed in blockquotes. I attempted to implement a feature that allows users to hide all the comments with just one click by using the following JavaScript code: const blockQuotes = document.getElementsByTagName(& ...

How come my keyframes animation isn't functioning properly on my div element?

I am currently designing a custom animation for a checkers game. My goal is to create an effect where the checker piece moves slowly to its next spot on the board. Below is the CSS code I have used: @keyframes animateCheckerPiece { 0% {top: ...

Tips for personalizing the Material-UI sticky header to work with horizontal scrolling

Check out this example of a Material UI table with a sticky header on CodeSandox: https://codesandbox.io/s/yi98d?file=/demo.tsx I encountered an issue where the left side header cells slide behind each other when I added a stickyHeader prop to the Materia ...

"I'm facing an issue with aligning elements in my ReactJS application using CSS Flexbox. Despite setting up a flexbox layout, I am unable to

Despite setting up a flexbox to align my elements, I am struggling with vertical centering on my page. I have made sure to use a container for the page and set brute size with viewport units. Here is my sandbox: https://codesandbox.io/s/rlk3j68pmq. Belo ...

How can the ID of a table row be retrieved if it is selected?

In my datatable, I have a list of Cars where each row contains a Car ID. A checkbox column has been added to the first cell in the table - when checked, the row is highlighted to show the user their selection. The goal is to retrieve the IDs of all selecte ...

Fade in elements as the cursor moves, without hovering over a specific element

I'm working on implementing a fade-in effect for content when the mouse moves (similar to Google's homepage), but I'd like to avoid this behavior if the cursor is hovering over a specific div. Here are the basics: $("html").hover(function( ...

Manipulating content with JavaScript in Internet Explorer using the outerHTML property is a powerful

Encountering an Issue with outerHTML in IE Browser If I try the following: txt = "Update Complete!"; msg = sub.appendChild(d.createElement("p")); msg.outerHTML = txt; It works without any problem. However, if I use: txt = "1 Error:<ul><li> ...

Looking to update the meta tags for a specific page in Next.js using the Head component?

In my project using next js 13 with pages structure, I have set up _document with meta tags and title for global pages using Head. However, I am now facing an issue where I want to define specific meta tags and title for a single page called "one". Despite ...

Enhance the appearance of Font Awesome stars by incorporating a hover effect

Is there a straightforward way to make them turn solid yellow when you hover over them? const styles = theme => ({ root: { flexGrow: 1, overflow: 'hidden', padding: theme.spacing(0, 3), }, paper: { maxWidth: 800, mar ...

Laravel is having trouble loading CSS and JS files

Despite trying multiple solutions, my application on the server is still not loading the CSS and JS files in main.blade.php when the CSS files are located in public/assets_setup/css/style.css. I have made changes to the files, but the page remains the same ...

Replacing the CSS Reset with the Universal Selector

I implemented Eric Meyer's Reset to set the font, and then loaded my stylesheet to globally set the font using the universal selector. Even though I loaded the universal selector in my SASS after the reset, the reset is still taking precedence. (Atta ...

Outdated JavaScript Alert

Is it possible to use JavaScript to create an alert message in my input field when a past date is selected? I would like the warning to say "past date, please enter a valid date." <html lang="en"> <head> <meta charset="U ...

Having difficulty getting the HTML table formatting and colors to display properly

Explore the custom netting options for baseball and softball batting cages here. It seems like there might be an issue with displaying tables and background colors in the description field. We'll look into it! ...

The "else" statement is never being executed

Trying to create a form where users enter their first name, last name, and city. If any input is empty or contains numbers, a message should appear requesting to fill out all boxes without numbers. Otherwise, display a personalized quote using the input in ...

Examining the functionality of my PHP codes and forms

I'm currently working with two HTML forms and two PHP scripts. The first form is designed to save a user's email to a .txt file, while the second form is a Stripe payment form that processes payments using PHP code. However, I've encountere ...

How can I ensure that my SVG Image perfectly fits within the Parent wrapper div?

I've been grappling with the following code snippet. I'm struggling to make my SVG image fit within my container div. .img { margin: 0; padding: 0; overflow: hidden; width: 500px; position: relative; } img { top:0; ...

Error: Timthumb is redirecting to a 404 page when trying to load image

Timthumb has been working perfectly on my live site, but suddenly stopped working on localhost. The image source is written as follows... Although the image opens when I click and open in a new tab, it does not display on the current page... <img src= ...

Why is it that aligning items in a row doesn't seem to function properly when I apply a custom class to a container-fluid in Bootstrap 4?

Recently, I started delving into the world of front end development. After mastering the basics of HTML5 and CSS3, I ventured into Bootstrap 4. My current project involves creating a replica of the Facebook login page. To achieve a full-width design, I uti ...

When you click, a new webpage opens within my website, similar to the feature on Facebook

When using Facebook on mobile, clicking on a link to a person's website opens the website in front of the Facebook page. However, when users press the X in the top left corner, it deletes the webpage but keeps Facebook open. On my desktop computer, I ...