Stacking two divs for the team section layout

Although I'm new to this, I've been struggling to achieve a specific layout for a team page. My goal is to display a picture on the left side and text on the right for each team member. The design includes the person's name, title, and a set of badge links (for email, LinkedIn, and Twitter) positioned neatly below the title using a table. I have managed to create the layout for one person successfully with the following HTML:

<div class="left">
    <img src="url"/>
</div>
<div class="right">  
    <H3>Name</H3>
<H4>Title</H4>
<table>
    <tr>
        <td><a href="mailto:email"><img src="url"/></td>
    <td><a href="http://linkedin.com/url"><img src="url"/></a></td>
    <td><a href="url"><img src="url"/></a></td>
    </tr>
</table>
<p>Experience</p>
<p>Experience</p>
<p>Experience</p>
</div>

Here is the CSS code used:

.left img{
      position:relative; 
      float:left;
      height:15%;
      width:15%;
      top:50px;      
}

.right{
       position: relative;
       float:left;
       margin-top:10px;
}

.right h3{
    color:#39c388;
    font-weight:bold;
    font-family:Arial,sans-serif;
    font-size:28px;
    position:relative;
    top:30px;
    left:20px;
}

.right h4{
    color:#818286;
    font-family:Arial,sans-serif;
    font-size:24px;
    position:relative;
    top:20px;
    left:20px;
}

.right td img{
    width:20px;
    height:20px;
    position:relative;
    top:20px;
    left:20px;
}

.right td{
    width:30px;
}

.right p{
    color:#818286;
    font-family:Arial,sans-serif;
    font-size:20px;
    position:relative;
    top:40px;
    left:20px;
}

Now, I want to repeat this layout for multiple team members stacked on top of each other. How can I achieve this? I've tried enclosing the HTML code in a div with a specified class and playing around with properties like position and z-index, but I haven't had any luck.

Answer №1

If your intention is for the elements to be placed on top of each other in a layered manner, you should utilize the following CSS:

{position: absolute; top: 0; left: 0}
(adjusting the top and left positions as needed)

Apply this to the container <div> for each section.

On the other hand, if by 'stack on top of each other' you mean that they are listed vertically down the page, simply utilizing a container <div> should suffice. You might need to include {overflow: hidden} (and {height: 1%} for IE 6 - 8) to account for any floating child elements within the container <div> and the left 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 with getting basic CSS to work with React's MUI framework

I've been attempting to incorporate basic CSS with MUI components. According to their website, it should be feasible. https://material-ui.com/guides/interoperability/#plain-css But unfortunately, I'm having trouble getting it to function prope ...

Retrieve the JSON data embedded within the HTML source code and utilize its contents

I stumbled upon a URL like http://example.com. Taking a look at the HTML source, it appears as follows: <html> test test2 {"customer":{"email":null,"is_eu":true"} t </html> My goal is to extract the JSON data from this source and then manipul ...

Is there a way for me to manipulate the RGB values of the canvas in such a manner that the Red and Green components of the gradient are determined by dividing the position of my mouse cursor

My homework assignment requires using RGB colors where the red value is set to 0, green is the x-coordinate divided by 2, and blue is the y-coordinate divided by 2. I've been trying to control the colors on a canvas using addColorStop functions, but I ...

Welcome to the launch of OpenWeatherMap!

I just signed up for an account on the OpenWeatherMap website. My goal is to retrieve the current weather information for a specific location using the City ID API Call: http://api.openweathermap.org/data/2.5/weather?id=2172797&appid=myAPIKey How ca ...

Eliminate the unnecessary gap below the image

I have noticed that there is too much space beneath an image on my website. I have tried checking for extra tags, but I suspect that it might be controlled in a css file. Could someone please help me identify which part of the css is causing this extra ...

Can floated divs be prevented from collapsing without taking up any width?

Let's discuss an issue that is not related to block elements collapsing when their children are floated, and has nothing to do with clearing at all. Imagine having a set of floated divs like: <div class="column">Column 1</div> <div cl ...

Concatenating strings with JavaScript

I am currently working on building a web page using a combination of html and javascript. I have a json file that provides inputs for some specific content I need to display. My main goal is to set up an address variable in order to show the Google Maps AP ...

The battle between Hover, Focus, and Blur modes intensifies

My goal is to implement 4 different effects on an element: When hovering over the element. When moving away from the element. When focusing on the element. When blurred. However, I'm encountering a conflict where when I focus on the element, the ...

Utilize jQuery to extract URL parameters and incorporate them into a script

I have a unique link: http://mywebsite.org/product/page?var_one=result1&var_two=result2&var_three=result3&var_four=result4 The values can vary, meaning the parameters are not fixed. My example includes 4 parameters, but there could be more ...

Can you explain the mechanics behind the animation of the upvote button on steemit.com?

Behold the upvote button of steemit.com: <span class="Icon chevron-up-circle" style="display: inline-block; width: 1.12rem; height: 1.12rem;"> <svg enable-background="new 0 0 33 33" version="1.1" viewBox="0 0 33 33" xml:space="preserve" xmlns=" ...

Tips for updating the submit button title in HAML

Just getting started with Haml, I have a form that contains two submit buttons. In order to differentiate and handle them in the Controller, each button requires its own unique name. For example, in HAML: = program_form.submit I18n.t('texts.6OA&apos ...

Overlap with upper picture formatting

I've been struggling to create an ion-card with two images: a main picture and a small book cover. Any ideas on how to achieve this? Note: The layout should have 2 images, one at the top and another as a small book cover. Check out this sample on St ...

Design a customizable input field to collect HTML/JS tags

I'm looking to incorporate a similar design element on my website. Can anyone offer me some guidance? Check out the image here ...

Encountering a 500 Internal Server Error while attempting to insert data into a MYSQL database using

I am experiencing an issue while trying to insert radio checked data values into a MySQL database using PHP, jQuery, and AJAX. Whenever I attempt to insert the values, I encounter an internal server 500 error... Any assistance would be greatly appreciated ...

Can you provide a succinct explanation of what constitutes a well-defined "landing page"?

Could someone provide a clear and concise explanation of what exactly constitutes a landing page and how it should be utilized? I'm struggling to grasp the concept. Where is the optimal placement for a landing page on a website? Is it best placed o ...

The hamburger menu is malfunctioning and spilling over

// App.js import './App.css'; function App() { return ( <div className='navbar'> <label className="hamburger-menu"> <input type="checkbox" /> </label> <div class ...

Using jQuery to toggle the visibility of div elements while displaying an indicator

A query arises regarding the utilization of JQuery to facilitate toggling the visibility of text divs. The question pertains to how one can incorporate an indicator - such as an up and down arrow graphic - to denote whether the divs are open or closed. Sug ...

Having trouble with JQuery's .prop function not unchecking a checkbox?

I have been experimenting with different solutions in order to uncheck a checkbox when another checkbox is checked. Unfortunately, none of the methods I've tried seem to be working effectively... Currently, my code looks like this: $("#chkBox1").cli ...

Numerous text boxes sharing identical IDs

Here is the code snippet that I am working with: <%for (int index = 1; index < 7; ++index) {%> <tr> <td> <div class="indicacao_gdp"> ...

When setting the form action attribute in jQuery, the parameter being passed may be null

My goal is to redirect my form action to another page with a URL parameter. Here's the code I'm using: ui.setFormActionToTargetPage = function () { $('form').get(0).setAttribute('action', 'myTargetPage.html?id=' ...