Positioning an item beneath two floating objects

Trying to create a visually interesting element on my website with 2 circles overlapping their parent element and 1 overlapping below. How can I make the third one centered below the first two?

I've experimented with float left and right, but not sure how to handle the third circle. Maybe positioning them inline will work best.

If anyone has tips on making 2 circles align horizontally and the third centered below, please share!

Hope that makes sense, it's tricky to explain.

#bile{
background: white;
width: 100%;
height: 150px;
}
.kolecko{
position: absolute;
top: -10%;
display: table;
width: 100px;
height: 100px;
border-radius: 50%;
background: gray;
border: 1px solid black;
box-shadow: inset 0 0 20px #000;
}
.kolecko:hover{
box-shadow: inset 0 0 20px #fff;
}
.popisek{
vertical-align: middle;
text-align: center;
display: table-cell;
font-size: 15px;
}
.popisek:hover{
color: blue;
}

.obal{
display: inline-flex;
justify-content: space-evenly;
flex-wrap: wrap;
}
#rude{
width: 100%;
position: relative;
height: 250px;
background: #720000;
padding: 0 15%;
}

.kolecka{
display: inline-block;
width: 100px;
margin-right: 10%;
}
.kolecka:last-child{
margin-right: 0;
}
<section id="bile"></section>
<section id="rude">
<div class="kolecka">
<div class="obal">
<div class="kolecko"> 
<div class="popisek">WWW</div>
</div>
</div>
</div>

<div class="kolecka">
<div class="obal">
<div class="kolecko"> 
<div class="popisek">abs</div>
</div>
</div>
</div>

<div class="kolecka">
<div class="obal">
<div class="kolecko" style="float: right;">
<div class="popisek">123</div>
</div>
</div>
</div>

</section>

Answer №1

Have a look and see if this is the solution you were looking for

#bile{
  background: white;
  width: 100%;
  height: 150px;
}
.kolecko{
//position: absolute;
top: -10%;
display: table;
width: 100px;
height: 100px;
border-radius: 50%;
background: gray;
border: 1px solid black;
box-shadow: inset 0 0 20px #000;
}
.kolecko:hover{
box-shadow: inset 0 0 20px #fff;
}
.popisek{
vertical-align: middle;
text-align: center;
display: table-cell;
font-size: 15px;

}
.popisek:hover{
color: blue;
}

.obal{
display: inline-flex;
justify-content: space-evenly;
flex-wrap: wrap;
}
#rude{
width: 100%;
position: relative;
height: 250px;
background: #720000;
padding: 0 15%;
}

.kolecka{
display: block;
width: 100px;
margin-right: 10%;
position: absolute;
bottom: 100%;
}
.kolecka:last-child{
margin-right: 0;
    right: 0;
}
.kolecka:nth-child(2){
  margin: 0 auto;
  position: relative;
  top: 100%;
}
<section id="bile"></section>
<section id="rude">
<div class="kolecka">
<div class="obal">
<div class="kolecko"> 
<div class="popisek">WWW</div>
</div>
</div>
</div>

<div class="kolecka">
<div class="obal">
<div class="kolecko"> 
<div class="popisek">abs</div>
</div>
</div>
</div>

<div class="kolecka">
<div class="obal">
<div class="kolecko" style="float: right;">
<div class="popisek">123</div>
</div>
</div>
</div>

</section>

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

Using Express, Node, and JQuery to handle form submissions

I am struggling with form submissions while working on a web app using HTML, Express, and Node.js. Despite being new to these technologies, I have created a script that generates a dynamic form based on certain factors: $FormContainer.html(''); ...

The shade of gray on Google Maps is distinctive

Why is my Google Maps script gray when the page loads? When I inspect the elements, it seems like it's due to resizing. Can anyone help me with this issue? Thanks in advance for any assistance. Below is the HTML code for the map which is included with ...

Saving HTML code entered in a textarea field does not work with the database

Recently, I encountered an issue on my website related to storing news posts in HTML format. My initial approach was to write the posts in HTML for better presentation and then transfer this code into a Textarea element. The plan was to save this input in ...

Ways to showcase INPUT TYPE when making a Selection?

I've been struggling with a simple issue and despite trying multiple solutions, I can't seem to get it right. I have a form where I'm using the <select> tag with two options: coo and uh. What I want is for an additional input type fiel ...

GET requests will not be allowed

Having an unusual issue where the GET parameters are not being passed properly. <!DOCTYPE html> <html> <body> <?php var_dump($_GET); var_dump($_POST); ?> <form action="test.php?ds=1" m ...

What causes the CSS `resize` property to be inherited in Chrome browsers?

It was my understanding that elements do not inherit the resize property from their parent elements. However, I recently discovered that in Chromium they actually do: Here is a screenshot of Chromium's inspector: Check out this demo: http://jsfi ...

Issue with overlapping positioning of child components in React

I've come across multiple inquiries addressing this issue, yet none of them have provided a solution that fits my problem. In my scenario, there's a Parent component containing three Child components. import React, { Component } from 'react ...

Alignment issue detected

I was attempting to center these 4 divs inside a container both horizontally and vertically, but they are stuck at the top edge of the <div>. They aren't moving down and remain fixed at the top. /* Footer */ #footer { width: 100%; hei ...

What is the best way to incorporate a dynamic background image into a panel heading using Twitter Bootstrap 3 for a responsive design?

Hey everyone! I'm having trouble adding an image as a background to my panel heading and also including an h3 inside it. Below is the code I am using: <div class="row col-wrap"> <div class="col-lg-4 col"> < ...

Glyphicons are not functioning properly

I've been trying to use the bootstrap-cosmo.css v3.3.7 file which contains the glyphicon -glyphicon-duplicate .glyphicon-duplicate:before { content: "\e224"; } However, when I try to use it, the icon doesn't show up. <a class="btn btn- ...

PHP time counting script

Can a countdown script be created using PHP? Websites like 4shared.com or megaupload.com utilize a similar script that starts counting from 20 seconds to 0. I am able to see how many seconds are left on the web page before I can click on the download but ...

Incorporating an iframe seamlessly into a div element with scroll functionality

To start off, you can find the code in this JSFiddle link I am attempting to include an iframe as if it were a div. I understand how to do this with a regular iframe, but the one I am using contains a slider, resulting in two vertical scroll bars appearin ...

Vertical scroll through a list of columns with a stationary header, while allowing both the list and the header to

Check out this JSFiddle example: https://jsfiddle.net/jefftg/1chmyppm/ The layout currently has orange header columns and white list rows that scroll together horizontally. However, the goal is to have the white list rows scroll vertically while keeping t ...

I seem to be having trouble getting my style to work properly with Material UI's makeStyles

I am experiencing an issue with Material-UI makeStyles not working properly. I am trying to apply my CSS style but it doesn't seem to be taking effect. I suspect that Bootstrap or MaterialTable might be causing this problem. While Bootstrap4 works fin ...

Harvesting data from an HTML document using BeautifulSoup and Python

I am currently working on extracting text from an HTML file. The HTML file has the following structure: <li class="toclevel-1 tocsection-1"> <a href="#Baden-Württemberg"><span class="tocnumber">1</span> <span class= ...

"Effortlessly move elements with HTML5 drag and drop functionality from either direction

I'm working on an application that requires Html5 Drag and Drop functionality, which is currently functioning well. However, in the app, there may be instances where a dropped item is no longer needed and I want to allow users to re-drag and drop it b ...

The data-ls attribute is currently not permitted on the svg element. Is there a way to fix this issue?

Upon running my site through the w3cvalidator tool, I encountered the following errors: "Attribute data-ls not allowed on svg element at this point" and "End tag svg did not match the name of the current open element (use)". Below is a snippet of the cod ...

React Ant Design: Encountered a warning for 2 elements having non-unique properties

I have incorporated the Carousel component, with each one containing a different component. One contains a form, while the other includes an external library component called react-input-otp. https://codesandbox.io/s/pensive-einstein-uucvm?fontsize=14& ...

How to change the file name of an HTML page in a website template?

After downloading a free dashboard website template from the internet, I've been trying to incorporate it into my own website. My main focus now is on creating a navbar that opens the relevant page upon clicking. To do this, I duplicated the html fi ...

Emphasize/Style text fields

I am seeking to incorporate a real-time difference viewer into a webpage that maintains whitespace. In the past, I utilized TinyMCE and JQuery in IE6 for a similar project, but it did not preserve whitespace. TinyMCE was not suitable as it is a WYSIWYG ed ...