Tips for arranging cards in a stacked position: To create a visually

I'm currently developing a project using react typescript, and I need to showcase various projects in the form of cards. However, I would like these cards to be displayed in a stacked layout like this

Here is the component for displaying the projects:

export function Project({ project }: { project: IProject }) {
  return (
  
          <Card title={project.title} bordered={true} className="Card-Project">
            <p>Description:{project.description}</p>
            <ul>
              Skills Required:
              {project.skillsRequired.map((skill, index) => (
                <li key={index}>{skill}</li>
              ))}
            </ul>
            <p> budget :{project.budget} CA$</p>
            <p>Experience Level: {project.experienceLevel}</p>
            <p>Category:{project.category}</p>
          </Card>
  )
}

Below is the CSS file for styling the card project :

.Card-Project {
  width: 180%;
  margin: 0 auto;
  padding: 24px;
  margin-top: 20px;
  margin-left: 250px;
  margin-bottom: 20px;
  background-color: hwb(0 97% 0%);
}

I have attempted to arrange them in a vertical order.

Answer №1

A simple method is to place them within a flex div container and set the flex-direction to column as shown below:

 <div classname="container">
   Insert the cards here...
 </div
.container {
  display:flex;
  flex-direction: column;
}

Answer №2

To enhance your CSS styling, consider including the display: block; declaration.

.Project-Card {
  width: 180%;
  margin: 0 auto;
  padding: 24px;
  margin-top: 20px;
  margin-left: 250px;
  margin-bottom: 20px;
  background-color: hwb(0 97% 0%);
  display: block;
}

Answer №3

give this approach a shot

    .Project-Card {
      max-width: 500px;
      margin: 20px auto;
      padding: 24px;
      background-color: hwb(0 97% 0%);
      box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.1);
    }

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

What is the best method for sending a DbGeography parameter to MVC?

I am working on developing an API that allows users to save polygons on the server using ASP.NET MVC 5. Can anyone guide me on how to properly format the AJAX parameters for posting requests with DbGeography? This is what I have tried so far: $.ajax({ ...

How to manipulate HTML dynamically in React using Apollo to avoid unnecessary component re-renders

Currently, I am using Apollo's useQuery function to retrieve a user and their posts in my project. The posts are displayed in both a summary view and a detailed view, with the detailed view positioned on top of the summary view. The visibility of the ...

Click the button to automatically generate a serial number on the form

My form includes three input fields: sl no, stationerytype, and stationeryqty. By clicking the symbols + and -, I can add or delete these fields. I am attempting to automatically generate a Sl no in the sl no field when I click the plus symbol, and adjust ...

What is the reason for having two select pickers?

Why do I have two select pickers instead of one? I'm encountering this issue when copying the first row of a table within my JavaScript function and pasting it as a new row upon pressing the "Add" button. There seems to be an issue with the select pic ...

Implementing a method for JQuery event handlers to access variables within a module pattern

var MODULE = (function() { var app = { hi: "hi dad", // How can I retrieve this value? onSubmitClick: function() { $('button').click(function() { console.log(hi); // Is there a way to access ...

Challenges with moving images in Unslider

There seems to be an issue with the unslider-arrows on the unslider banner. The images are not sliding properly when transitioning to the next image without user input. Instead, they resize from small to full size starting at the top of the .banner div. ...

What is the best way to incorporate an "if" statement into my code?

I'm in the process of setting up a section on my website where users can get live price estimates based on a value they input. While I have most of the formula in place, there's one final element that I need to figure out: introducing a minimum f ...

Is it feasible to have two interfaces in Typescript that reference each other?

I am facing an issue with two interfaces, UserProfile and Interest. Here is the code for both interfaces: export default interface UserProfile { userProfileId: string, rep: number, pfpUrl: string, bio: string, experience: "beginner" | " ...

What specific files from the Kendo core are required for utilizing Mobile and Angular functionalities?

After browsing through similar questions, I couldn't find a solution. Currently, I am experimenting with Kendo (open source core for now) in a Visual Studio Cordova project. Initially, disregarding Cordova, I am focusing on setting up a basic view wit ...

What is the best way to implement a secondary sticky navbar that appears on scroll of a specific section, positioned below the primary fixed-top navbar, using jQuery and Bootstrap 5?

I am facing a challenge with my webpage layout. I have a fixed-top navbar at the top, followed by 3 sections. The second section contains nav-tabs. What I want is for the nav-tabs navbar to stick to the top of the page below the fixed-top navbar when the u ...

Recording errors within the NodeJS / Express / React technology stack

Seeking help on logging errors in a React and NodeJS/Express application. How can I track errors occurring on the backend API server, whether in the node console or an external file? For instance, suppose there's an endpoint "/api/example" responsibl ...

What's the best way to keep the hover effect on my main tab while ensuring it doesn't impact the sub tabs?

I'm facing an issue with a hover effect on my "menu" tab that is also applying to the sub tabs within it. How can I prevent this from happening? Below is the code snippet causing the effect: `nav ul li:hover > a { color:#f9b97a; border-bottom:2p ...

What techniques can be used to maintain the value of 'this' when utilizing async.apply?

Employing async.parallel to simultaneously run 2 functions, initiated from a static function within a mongoose model. In this code snippet (where the model contains a static function named verifyParent), I utilize this to access the model and its functions ...

How can I make CSS images appear beside specific links?

Currently, I have implemented the following CSS: .entry a { padding: 2px 0 0 8px; background: transparent url(images/link_arrow_light.gif) left top no-repeat; text-decoration: underline; } It is functioning correctly, but the image is being added t ...

Ways to eliminate empty values from an array in JavaScript

I need help deleting any null elements from my array [ [ null, [ [Array], [Array] ] ] ] I am looking to restructure it as [ [[Array],[Array]], [[Array],[Array]], [[Array],[Array]] ] If there are any undefined/null objects like : [ [[Array],[]], [[A ...

The Ajax request keeps encountering a bad request error despite it working perfectly fine in Postman

After spending hours conducting extensive research and trying various methods without success, I am still unable to obtain a JWT token after providing the user and password. function listenForLogin() { console.log('listening') $('# ...

Utilizing jQuery Ajax to submit multiple forms using a single selector in one go

I'm having an issue with jQuery Ajax involving multiple forms. Each time I execute it, only the top form works properly while the others do not function as expected. Can anyone provide assistance with this? Here is the source code: <form id="form_ ...

Create a specific definition for a packaged item with limited access

As I worked with a package that lacked types, I took the initiative to create a type definition for it. The specific package in question is react-date-range. In order to accommodate this new type definition, I established a directory where it could be loca ...

Troubleshooting ASP.NET Ajax Error Code 0

Starting from scratch with asp.net and hoping to incorporate infinite scrolling using jQuery Ajax and ASP.NET MVC. Here's the progress so far: <div id="container"></div> <div id="progress" style="display:none"> <h4>Loading ...

The process of retrieving keys and values from localStorage in html5

I have stored some important key-value pairs in local storage. Now I need to retrieve both the keys and values, and then display them by appending the values in a list item (li). Currently, my attempt at this looks like: for (var i = 0; i < localStorag ...