Personalized Grid Design for Showcasing Athletic Teams

I am looking to create a custom grid layout that represents the team's Players, separated by their positions (GK, Defense, Midfielders, and Forwards), similar to the image below. The layout should also be responsive like in image 1.

Currently, the results we are achieving look like this in image 2.

.item1 {
  grid-area: main;
}

.item2 {
  grid-area: main;
}

.item3 {
  grid-area: footer;
}

.item4 {
  grid-area: footer;
}

.grid-container {
  grid-template-areas: 'main main main main' 'footer footer footer footer';
  gap: 30px;
  background-color: #000000;
  padding: 50px;
  display: inline-flex;
  justify-content: center;
  margin-left: 130px;
  margin-right: 5px;
}

.grid-container>div {
  background-color: rgb(255, 255, 255);
  padding: 60px 30px;
  font-size: 30px;
  align-content: center;
}

.container {
  position: relative;
  width: 50%;
}

.overlay {
  position: absolute;
  top: -60px;
  bottom: 0;
  left: -30px;
  right: 0;
  height: 160%;
  width: 260%;
  opacity: 0%;
  transition: .5s ease;
  background-color: #343536;
}

.image {
  display: block;
  width: 200px;
  height: 200px;
}

.container:hover .overlay {
  opacity: 1;
}

.text {
  color: white;
  font-size: 20px;
  position: absolute;
  top: 50%;
  left: 50%;
  -webkit-transform: translate(-50%, -50%);
  -ms-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  text-align: center;
}
<div id="plantel">
  <h1 id='Text'>Plantel</h1>
  <div class="grid-container">
    <div class="item1">
      <div class="container">
        <img src={jogadores1} alt="Avatar" class="image" />
        <div class="overlay">
          <p class="text">Roberto</p>
        </div>
      </div>
    </div>
    <div class="item1">
      <div class="container">
        <img src={jogadores2} alt="Avatar" class="image" />
        <div class="overlay">
          <p class="text">minha</p>
        </div>
      </div>
    </div>
    <div class="item1">
      <div class="container">
        <img src={jogadores3} alt="Avatar" class="image" />
        <div class="overlay">
          <p class="text">sua</p>
        </div>
      </div>
    </div>
  </div>
  <div class="grid-container">
    <div class="item4">
      <div class="container">
        <img src={jogadores1} alt="Avatar" class="image" />
        <div class="overlay">
          <p class="text">Roberto</p>
        </div>
      </div>
    </div>
    <div class="item4">
      <div class="container">
        <img src={jogadores1} alt="Avatar" class="image" />
        <div class="overlay">
          <p class="text">Roberto</p>
        </div>
      </div>
    </div>
    <div class="item4">
      <div class="container">
        <img src={jogadores1} alt="Avatar" class="image" />
        <div class="overlay">
          <p class="text">Roberto</p>
        </div>
      </div>
    </div>
  </div>

Answer №1

Adjust the width of grid-containers to be either 100vh or 100%

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

The absence of a `muiTheme` parameter in the `Toolbar` component was evident

I'm having trouble figuring out what's missing despite adding the muitheme attribute to my component. Can anyone recommend a good resource for learning how to implement material ui in meteor-react? import getMuiTheme from 'material-ui/style ...

Acquiring POST parameters within Laravel's Controller from JavaScript or Vue transmission

I am trying to send Form data from a Vue component to a Laravel API using the POST method. Although Laravel is returning a successful response, I am encountering difficulty in handling the POST data within the Laravel controller. Below is the code for th ...

Tips for hiding the bottom bar within a stackNavigator in react-navigation

I am facing a challenge with my navigation setup. I have a simple createBottomTabNavigator where one of the tabs is a createStackNavigator. Within this stack, I have a screen that I want to overlap the tab bar. I attempted to use tabBarVisible: false on th ...

The ng-model directive in drop-down selection elements

I have a series of questions along with their answers, and I want the user to select an answer from a drop-down menu. How can I achieve this? I've attempted the following code, but the select option isn't appearing on the screen. HTML: <div ...

sending back a JSON object that appears empty, despite actually containing data

I'm facing an issue where I am attempting to send a json response to my react client, containing a list of songs (objects). However, the json returns as an empty array. This is how I am fetching the data: let songs = []; fetch("https://api.spotify. ...

What are the steps for generating a diagram using Chart.js?

I'm attempting to use Chart.js to create a specific diagram. Current Challenges: The point on the x-axis should be centered within the categories. I would like the value to appear above the point. https://i.sstatic.net/FFFr1.png This is what my co ...

The Like and increment buttons seem to be unresponsive when placed within a FlatList component

Issues with the like and increment button functionality within the FlatList Here are my constructor, increment, and like functions: constructor(props){ super(props); this.state = { count: true, count1: 0, }; } onlike = () => ...

Changing the container's height in an HTML document

enter image description hereim struggling to change the height of the white dash container, and I can't quite figure out how to do it. Here is the code, any help would be appreciated: analytics.html : {% extends 'frontend/base.html' %} {% l ...

What is the process of importing an HTML template into a Vue.js project?

I downloaded a template from the internet that I want to import into my vue project. This template includes HTML, CSS, and Javascript files of its own. How can I utilize vue-router to access the index.html file in this template without converting them into ...

Generate a see-through overlay when hovering over an image that matches the image's precise dimensions

I have encountered a challenge that I need help with. On a webpage, there are multiple images of varying sizes. I am looking to create a feature where hovering over an image triggers the appearance of a div above it containing a button and text without dis ...

Issue: The code is throwing an error "TypeError: Cannot read property 'push' of undefined" in the JavaScript engine "Hermes

Can anyone assist me with filtering an array of objects in a TypeScript React Native project using state to store array values and filter objects in the array? Having trouble with the following error in the mentioned method: LOG after item LOG inside ...

Unexpected issue with sliding menu toggle implementation

I have been struggling to make a menu slide to the left when a button is clicked, and then slide back to its original position when the same button is clicked again. Although I have been using the toggle method, it doesn't seem to be working for me. I ...

Issue with DIV height in Internet Explorer occurs only when application is accessed using server name

Encountering a unique issue specific to IE (confirmed in v8 and v9). When utilizing jquery to determine the height of a div: $('#sys_MainPage').height() In Chrome, Firefox, and when accessing using the IP address, this code returns around 26 ...

Does anyone have tips on how to upload images to MongoDB using React?

Currently, I am working on a project that requires an image upload feature for users. These images need to be stored in MongoDB so that they can be viewed by the user later on. Can anyone offer assistance with this? I have successfully configured my datab ...

After implementing rewrites, my dynamic routes in Next.js are no longer functioning as expected

This is the current structure of my project and it was working fine before I added rewrites to my project. https://i.sstatic.net/X989W.png -dashboard --admin --page.tsx ---[adminId] ---page.tsx --cars --page.tsx ---[carId] ---page.tsx -lo ...

Tips for maximizing performance in ember-data through r.js

After making the switch to ember-data#canary, I encountered a problem with r.js failing. [Error: Error: ENOENT, no such file or directory '/scripts/lib/ember-data/ember-data/core.js' In module tree: app/main app/app embe ...

Error message: Module 'webpack-cli/bin/config-yargs' not found in React

I am facing an issue while trying to create a React app without using create-react-app. The error message I receive mentions changing webpack-dev-server to webpack serve in the package.json scripts, but it does not seem to work. Could someone please provi ...

What is the best way to transfer data from a React component to my Express API requests?

I'm a bit unsure about the best way to approach this. My app uses React/Redux/d3 on the client-side and Node/express on the server side (please correct me if I got that wrong). I want to give users the ability to update the API client using, for insta ...

Passing props from a parent component to a nested child component in Vue 3

My goal is to achieve the functionality described in the title. Suppose I have the following structure: parent -> child -> secondChild Currently, there is a variable called isActive in the parent component. Below is how it can be implemented: paren ...

"Can the form and action occur on the same page, or should they be

When it comes to form actions, what is more effective: having the action on the same page or a different page? See the sample code below: <form action="act.php"> html code </form> <form action=""> html code </form> < ...