I'm currently making this website for a company as a student intern learning and I was wondering how I could fix this issue where my product containers and promotion containers, when flipped or on a smaller phone it does not fix and the text and or buttons are out of the container. How can I fix this? I understand media queries but I don't have a full grasp on how I can even fix this with css.
HTML (Products)
<?php
require_once 'includes/dbh-inc.php';
$current_file_name = basename($_SERVER['PHP_SELF']);
$result2 = mysqli_query($conn,"SELECT `serviceID` FROM `addService` WHERE servicePageName = '".$current_file_name."'");
$row2 = mysqli_fetch_array($result2);
$ID2 = $row2['serviceID'];
$sql = "SELECT * FROM addProduct WHERE serviceID = '$ID2'";
$result = $conn-> query($sql);
if ($result-> num_rows > 0) {
while ($row = $result-> fetch_assoc()) {
echo '<div class="product-container" style="background-image: url(data:image/jpg;base64,'.base64_encode($row['imagetmp']).')">';
echo '<div class="service-title">';
echo '<h1>'. $row["product"] .'</h1>';
echo '</div>';
echo '</div>';
}
echo '</div>';
echo '</div>';
}
?>
CSS (Products)
/* Services Section */
.services-section {
background-attachment: fixed;
background-size: cover;
background-position: center;
justify-content: center;
}
.services-section a {
}
.services-section h1 {
color: var(--clr-text);
font-size: 3.5rem;
text-decoration: underline;
}
.services-section h2 {
color: var(--clr-text);
font-size: 2.5rem;
text-decoration: underline;
}
.title-section {
display: flex;
justify-content: center;
align-items: center;
padding: 2em;
}
.services {
display: grid;
gap: 10px;
margin-top: 1em;
grid-template-columns: repeat( auto-fit, minmax(250px, 1fr) );
justify-items: center;
}
.service-title {
display: flex;
justify-content: center;
background-color: var(--clr-background);
border: var(--clr-bg-border);
align-items: center;
flex-direction: column;
height: fixed;
width: fixed;
}
.service-container {
border: 5px solid var(--clr-primary);
background-size: cover;
background-position: center;
background-color: black;
height: 20vh;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
width: 30vh;
margin-bottom: 5vh;
}
.service-container i {
color: white;
padding: 0.5em;
float: right;
}
.service-container h1 {
color: var(--clr-text);
padding: 0.5em;
font-size: 1.5rem;
}
.service-container h2 {
color: var(--clr-text);
padding: 0.5em;
font-size: 1.5rem;
}
.service-container h1:hover {
color: var(--clr-secondary-text);
transition: ease 650ms;
}
.service-button {
display: flex;
justify-content: center;
align-items: center;
text-align: center;
padding: 2em;
}
.service-button a {
background-color: var(--clr-primary);
color: var(--clr-text);
text-decoration: none;
font-size: 2em;
padding: 0.5em;
}
.service-button a:hover {
color: black;
background-color: yellow;
text-shadow: -1px -1px 0 white, 1px -1px 0 white, -1px 1px 0 white, 1px 1px 0 white;
transition: ease 650ms;
}
.service-about {
display: flex;
justify-content: center;
background-color: var(--clr-background);
border: var(--clr-bg-border);
padding: 1em;
margin: 1em;
height: fixed;
width: fixed;
}
.service-about p {
color: var(--clr-text);
text-align: center;
font-size: 1.5rem;
}
.service-about span {
color: var(--clr-secondary-text);
text-align: center;
font-size: 1.5rem;
}
.service-about a {
color: var(--clr-secondary-text);
text-align: center;
font-size: 1.5rem;
}
.featured-services {
display: grid;
gap: 10px;
grid-template-columns: repeat( auto-fit, minmax(250px, 1fr) );
justify-items: center;
}
HTML (Promotion)
<div class="promotions">
<?php
require_once 'includes/dbh-inc.php';
$sql = "SELECT clientName, startDate, endDate FROM Clients";
$result = $conn-> query($sql);
$currentDate = date('Y-m-d');
$currentDate = date('Y-m-d', strtotime($currentDate));
$promotion;
if ($result-> num_rows > 0) {
while ($row = $result-> fetch_assoc()) {
if (($currentDate >= $row["startDate"]) && ($currentDate <= $row["endDate"])){
echo '<div class="promotion-container">';
echo '<div class="promotion-text">';
echo '<h1> '. $row["clientName"] .' is currently having a promotion.</h1>';
echo '</div>';
echo '<div class="promotion-button">';
echo '<button>Click Here</button>';
echo '</div>';
echo '</div>';
}
}
}
?>
</div>
CSS (Promotion)
/* PROMOTION PAGE */
.promotions {
min-height: 100vh;
display: grid;
color: var(--clr-text);
grid-template-columns: repeat( auto-fit, minmax(250px, 1fr) );
text-align: center;
justify-items: center;
margin-top: 1em;
}
.promotion-container {
border: 5px solid var(--clr-primary);
height: 20vh;
width: 30vh;
background-color: black;
}
.promotion-text h1 {
font-size: 1.15rem;
padding: 1em;
}
.promotion-button {
display: flex;
justify-content: center;
padding: 1em;
}
.promotion-button button {
color: var(--clr-text);
background-color: var(--clr-primary);
font-size: 1.15rem;
}
Image of my current issue
There are minimum two options:
You can customize your styles using flexbox or grid advantages.
You can write some styles for landscape orientation:
#media (orientation: landscape) {
// your specific styles for landscape
}
https://developer.mozilla.org/en-US/docs/Web/CSS/#media/orientation
Related
I can't figure out why the Icons are overlapping when I'm scrolling. I've already used overflow: hidden and tried various methods of hiding it. E.g with different divs that should hide one Icon.
HTML:
<div class="container">
<div class="bar">
<div class="flex-item">ID</div>
<div class="flex-item">Name</div>
<div class="flex-item">Erfassung</div>
<div class="flex-item">Frist</div>
<div class="flex-item"><img src="icons/logout_FILL0_wght400_GRAD0_opsz48.svg"></div>
</div>
<div class="data">
<?php
while($row = $result->fetch_assoc()) {
echo '<div class="dataRow" id="stat' . $row['Status'] . '">';
echo '<div class="flex-item">' . $row['ID'] . '</div>';
echo '<div class="flex-item">' . $row['Vorname'] . " " . $row['Nachname'] . '</div>';
echo '<div class="flex-item">' . $row['Erfassung'] . '</div>';
echo '<div class="flex-item">' . $row['Frist'] . '</div>';
echo '<div class="flex-item">' . '<img src="icons/arrow_forward_ios_FILL0_wght400_GRAD0_opsz48.svg" overflow="hidden">' . '</div>';
echo '</div>';
}
?>
</div>
</div>
CSS:
.container {
display: flex;
flex-direction: column;
}
.bar {
display: flex;
flex-wrap: nowrap;
font-weight: bold;
top: 0;
position: sticky;
margin-bottom: 0.5em;
background-color: #232323;
padding-block: 0.25em;
text-align: center;
align-items: center;
justify-content: center;
}
img {
width: 2.15em;
max-width: 2.15em;
filter: invert(100%);
}
.data {
display: flex;
flex-direction: column;
flex-wrap: nowrap;
justify-content: center;
align-content: center;
text-align: center;
}
.dataRow {
display: flex;
flex-direction: row;
margin-bottom: 0.25em;
}
#stat1 {
background-color: #c0161a;
}
#stat2 {
background-color: #c4c41b;
}
#stat3 {
background-color: #4cbb2d;
}
.flex-item {
display: flex;
align-items: center;
justify-content: center;
}
.flex-item:nth-child(1) {
flex: 1;
background-color: #373737;
margin-right: 0.25em;
padding: 0.5em;
}
.flex-item:nth-child(2) {
flex: 5;
background-color: #373737;
margin-right: 0.25em;
padding: 0.5em;
}
.flex-item:nth-child(3) {
flex: 2;
background-color: #373737;
margin-right: 0.25em;
padding: 0.5em;
}
.flex-item:nth-child(4) {
flex: 2;
background-color: #373737;
margin-right: 0.25em;
padding: 0.5em;
}
.flex-item:nth-child(5) {
flex: 0.5;
background-color: #373737;
}
How can I prevent the overlapping?
The idea is that when the user is scrolling, the bar sticks to the top and nothing is overlapping. So the bar is always on top. Including the Icon.
Example
Problem: The sticky header is on the same z-index level as the content, which causes the header and content to overlap.
Solution: Tell the browser that the sticky header should be on top of the data, by using z-index. More info here.
CSS:
.container{
z-index:2;
}
.bar{
z-index:2;
}
.data{
z-index:1;
}
have you try to use flex grid? it can maybe solve the problem.
Here is the JSfiddle complete code link:
CODE
my clock code output
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
background: #0b172a;
font-family: sans-serif;
}
#container {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding: 5rem;
color: white;
text-transform: uppercase;
}
.clock-ctr {
position: relative;
border: 2px solid white;
height: 80vh;
width: 80vw;
padding: 10px;
display: flex;
justify-content: center;
align-items: center;
}
.hour-ctr {
grid-area: hour;
}
.min-ctr {
grid-area: min;
}
.sec-ctr {
grid-area: sec;
}
.ampm {
grid-area: ampm;
background: #bc4123;
}
.time-ctr {
position: absolute;
height: 70%;
width: 90%;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: auto;
gap: 10px;
grid-template-areas: "hour min sec" "ampm ampm ampm";
}
h1 {
margin-bottom: 1rem;
letter-spacing: 8px;
font-size: 2.5rem;
}
.time-box {
background: #bc4123;
border-radius: 10px;
display: grid;
justify-items: center;
align-items: center;
height: auto;
text-align: center;
font-weight: bold;
font-size: 28px;
}
<div id="container">
<h1 class="clock-title">Clock</h1>
<div class="clock-ctr">
<div class="time-ctr">
<div class="hour-ctr time-box">
<p class="hour-value">00</p>
<p class="hour-title">Hour</p>
</div>
<div class="min-ctr time-box">
<p class="min-value">00</p>
<p class="min-title">Minute</p>
</div>
<div class="sec-ctr time-box">
<p class="sec-value">00</p>
<p class="sec-title">Second</p>
</div>
<p class="ampm time-box">AM</p>
</div>
</div>
</div>
Can any one tell me how to improve this code
I tried to make is completely responsive but it is not not working,
I tired to use flex to make the element appear in center of page.
Then I use grid to create the clock layout and i didn't knew how to align the cells so I used grid again in them. I was using rem and em to make responsive code but it didn't work out well. please review my code.
This is because of the font-size of the time-box div that is not responsive (28px whatever the device size), To make it responsive I added media queries to change the font depending on the device width, As presented in this example:
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
background: #0b172a;
font-family: sans-serif;
}
#container {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding: 5rem;
color: white;
text-transform: uppercase;
}
.clock-ctr {
position: relative;
border: 2px solid white;
height: 80vh;
width: 80vw;
padding: 10px;
display: flex;
justify-content: center;
align-items: center;
}
.hour-ctr {
grid-area: hour;
}
.min-ctr {
grid-area: min;
}
.sec-ctr {
grid-area: sec;
}
.ampm {
grid-area: ampm;
background: #bc4123;
}
.time-ctr {
position: absolute;
height: 70%;
width: 90%;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: auto;
gap: 10px;
grid-template-areas: "hour min sec" "ampm ampm ampm";
}
h1 {
margin-bottom: 1rem;
letter-spacing: 8px;
font-size: 2.5rem;
}
.time-box {
background: #bc4123;
border-radius: 10px;
display: grid;
justify-items: center;
align-items: center;
height: auto;
text-align: center;
font-weight: bold;
}
#media (min-width:768px) {
.time-box {
font-size: 18px;
}
}
#media (min-width:1024px) {
.time-box {
font-size: 22px;
}
}
#media (min-width:1280px) {
.time-box {
font-size: 28px;
}
}
<div id="container">
<h1 class="clock-title">Clock</h1>
<div class="clock-ctr">
<div class="time-ctr">
<div class="hour-ctr time-box">
<p class="hour-value">00</p>
<p class="hour-title">Hour</p>
</div>
<div class="min-ctr time-box">
<p class="min-value">00</p>
<p class="min-title">Minute</p>
</div>
<div class="sec-ctr time-box">
<p class="sec-value">00</p>
<p class="sec-title">Second</p>
</div>
<p class="ampm time-box">AM</p>
</div>
</div>
</div>
You can as well use calc() function, so you can calculate your font size relative to the screen width like this:
* {
padding: 0;
margin: 0;
box-sizing: border-box;
}
body {
background: #0b172a;
font-family: sans-serif;
}
#container {
height: 100vh;
display: flex;
align-items: center;
justify-content: center;
flex-direction: column;
padding: 5rem;
color: white;
text-transform: uppercase;
}
.clock-ctr {
position: relative;
border: 2px solid white;
height: 80vh;
width: 80vw;
padding: 10px;
display: flex;
justify-content: center;
align-items: center;
}
.hour-ctr {
grid-area: hour;
}
.min-ctr {
grid-area: min;
}
.sec-ctr {
grid-area: sec;
}
.ampm {
grid-area: ampm;
background: #bc4123;
}
.time-ctr {
position: absolute;
height: 70%;
width: 90%;
display: grid;
grid-template-columns: 1fr 1fr 1fr;
grid-template-rows: auto;
gap: 10px;
grid-template-areas: "hour min sec" "ampm ampm ampm";
}
h1 {
margin-bottom: 1rem;
letter-spacing: 8px;
font-size: 2.5rem;
}
.time-box {
background: #bc4123;
border-radius: 10px;
display: grid;
justify-items: center;
align-items: center;
height: auto;
text-align: center;
font-weight: bold;
font-size: calc(18px + 0.390625vw);
}
<div id="container">
<h1 class="clock-title">Clock</h1>
<div class="clock-ctr">
<div class="time-ctr">
<div class="hour-ctr time-box">
<p class="hour-value">00</p>
<p class="hour-title">Hour</p>
</div>
<div class="min-ctr time-box">
<p class="min-value">00</p>
<p class="min-title">Minute</p>
</div>
<div class="sec-ctr time-box">
<p class="sec-value">00</p>
<p class="sec-title">Second</p>
</div>
<p class="ampm time-box">AM</p>
</div>
</div>
</div>
the issue with the CSS code in the Stack Overflow question is that the left and right values for the #nav element are set to 0. This causes the element to take up the full width of its parent element, which is likely not the intended behavior.
To fix this issue, you can try setting the left and right values to auto like this:
#nav {
position: fixed;
top: 0;
left: auto;
right: auto;
width: 100%;
height: 60px;
background-color: white;
box-shadow: 0px 2px 4px rgba(0, 0, 0, 0.2);
z-index: 1000;
}
With this change, the #nav element will no longer take up the full width of its parent element and will instead be positioned at the top of the page with its width set to 100%.
So I feel like I have tried everything to make this button go to the bottom of the div but nothing seems to work. If I switch the container div to align-content: flex-end everything moves to the bottom as it should but I am trying to keep the divs at the top and only bring down the button. I am using React and CSS Modules.
import styles from './Total.module.css';
const Total = ({ tipTotal, total, handleReset }) => {
return (
<div className={styles.total}>
<div className={styles.totalTipAmount}>
<div className={styles.totalLeft}>
<div className={styles.totalTop}>Tip Amount</div>
<div className={styles.totalBottom}>/ person</div>
</div>
<div className={styles.totalRight}>${tipTotal}</div>
</div>
<div className={styles.toalAmount}>
<div className={styles.totalLeft}>
<div className={styles.totalTop}>Total</div>
<div className={styles.totalBottom}>/ person</div>
</div>
<div className={styles.totalRight}>${total}</div>
</div>
<button className={styles.totalReset} onClick={handleReset}>
RESET
</button>
</div>
);
};
export default Total;
.total {
display: flex;
align-self: center;
flex-direction: column;
width: 80%;
min-width: 80%;
margin: 30px 0;
background-color: var(--Very-dark-cyan);
border-radius: 15px;
padding: 30px 15px 5px 15px;
}
.total div {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
justify-self: flex-start;
}
.totalLeft {
display: flex;
flex-direction: column;
}
.totalTop {
color: var(--White);
font-size: medium;
margin-bottom: 5px !important;
}
.totalBottom {
font-size: small;
color: var(--Dark-blueish-cyan);
}
.totalRight {
font-size: xx-large;
color: var(--Strong-cyan);
}
.total button {
background-color: var(--Strong-cyan);
color: var(--Very-dark-cyan);
font-size: large;
font-weight: 700;
width: 100%;
max-width: 100%;
}
#media (min-width: 900px) {
.total {
height: 100%;
grid-column-start: 2;
grid-row-start: 1;
grid-row-end: 4;
justify-self: center;
}
.total button {
align-self: flex-end;
}
}
remove width:100% from button tag css
.total {
height: 100%;
grid-column-start: 2;
grid-row-start: 1;
grid-row-end: 4;
justify-self: center;
position:relative;
}
.total button {
align-self: flex-end;
position: absolute;
right: 20px;
}
body, html {
height: 100%;
}
.total {
display: flex;
flex-direction: column;
width: 80%;
min-width: 80%;
margin: 30px 0;
background-color: var(--Very-dark-cyan);
border-radius: 15px;
padding: 30px 15px 5px 15px;
height: 80%;
border: 1px solid red;
justify-content: space-between;
}
.totalTipAmount, .totalAmount {
display: flex;
justify-content: space-between;
margin-bottom: 10px;
}
.totalLeft {
display: flex;
flex-direction: column;
}
.totalTop {
color: var(--White);
font-size: medium;
margin-bottom: 5px !important;
}
.totalBottom {
font-size: small;
color: var(--Dark-blueish-cyan);
}
.totalRight {
font-size: xx-large;
color: var(--Strong-cyan);
}
.totalReset {
justify-self: flex-end;
border: 1px solid blue;
}
.total button {
background-color: var(--Strong-cyan);
color: var(--Very-dark-cyan);
font-size: large;
font-weight: 700;
width: 100%;
max-width: 100%;
}
#media (min-width: 900px) {
.total {
height: 100%;
grid-column-start: 2;
grid-row-start: 1;
grid-row-end: 4;
justify-self: center;
}
.total button {
align-self: flex-end;
}
}
<div class="total">
<div class="stuffAtTheTop">
<div class="totalTipAmount">
<div class="totalLeft">
<div class="totalTop">Tip Amount</div>
<div class="totalBottom"}>/ person</div>
</div>
<div class="totalRight">${tipTotal}</div>
</div>
<div class="totalAmount">
<div class="totalLeft">
<div class="totalTop">Total</div>
<div class="totalBottom">/ person</div>
</div>
<div class="totalRight">${total}</div>
</div>
</div>
<button class="totalReset">
RESET
</button>
</div>
</div>
I want to place a text inline and between two arrows. at first it seems easy but I can't place everything in their right place:
html, body {
height: 100%;
}
body {
background: #fafafc;
margin: 0;
}
.flex-container {
height: 100%;
padding: 0;
margin: 0;
display: -webkit-box;
display: -moz-box;
display: -ms-flexbox;
display: -webkit-flex;
display: flex;
align-items: center;
justify-content: center;
}
.grid-container {
width: 50%;
display: grid;
grid-template-columns: 40px auto 40px;
}
.referenceText {
font-family: Arial;
display: inline-block;
font-size: 3vw;
color: #4287f5;
/*outline: 0.1vw dashed red;*/
}
.link {
font-size: 200px;
color: #a7a4bf;
text-decoration: none;
width: 100px;
height: 100px;
outline: 0.1vw dashed orange;
}
.link:hover {
color: #636175;
}
<div class="flex-container">
<div class="grid-container">
<a class="link" href="">‹</a>
<div class="referenceText">This is the reference</div>
<a class="link" href="">›</a>
</div>
</div>
Please note that we want the arrows to be at the edges of the screen and the text at the center...
Make these changes in .grid-container and .link
.grid-container {
width: 80%;
display: grid;
grid-template-columns: 100px auto 100px;
align-items: center;
justify-items: center;
}
.link {
font-size: 200px;
color: #a7a4bf;
text-decoration: none;
width: 100px;
/* height: 100px; remove height*/
outline: 0.1vw dashed orange;
}
check codepen
Add display: flex;, align-items: center; and justify-content: space-between; to .grid-container and change the width to 100%.
Hope someone can shed light on this question of mine.
I have a flex container, which has 2 flex containers with flex-direction: column.
However, it all displays in 1 column.
Initially, it displayed in 2 columns but did not start at the same height, and now it is in one column only.
Advise here will be appreciated.
<!-- ***** finding container ***** -->
section.finding-container {
top: 180px;
display: flex;
flex-direction: row;
position: absolute;
justify-content: space-between;
align-items: center;
/* height: 100% */
/* margin-right: 215px; */
}
.find-agent {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 350px;
margin-bottom: auto;
margin-left: 50px;
}
.find-agent img,
h1,
p,
button {
display: block;
margin-left: auto;
margin-right: auto;
}
.find-agent h1 {
font-weight: 550;
color: #1E95EE;
text-align: center;
margin-top: 12px;
margin-bottom: 0;
}
.find-agent p {
color: #3A3C3E;
font-weight: 350;
width: 445px;
height: 71px;
text-align: center;
opacity: 1;
}
.try {
border: 2px solid #1E95EE;
border-radius: 5px;
opacity: 1;
color: #1E95EE;
font-size: 18px;
font-weight: Regular;
height: 50px;
width: 143px;
text-align: center;
vertical-align: middle;
text-decoration: none;
justify-content: center;
}
.agent-profiles {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 0;
margin-bottom: auto;
}
.agent-profiles h2,
img {
display: block;
margin-left: auto;
margin-right: auto;
}
.agent-profiles h2 {
font-weight: 350;
color: #1E95EE;
text-align: center;
width: 182px;
height: 44px;
letter-spacing: 0;
opacity: 1;
}
```
<!-- ***** finding container ***** -->
<section class="finding-container">
<div class="find-agent">
<img src="./images/search.svg" alt="search">
<h1>Find the perfect agent</h1>
<p>
No more browsing through thousands of applications. Each week, we'll send you a fresh batch of hand-picked, personally-vetted candidates.
</p>
<button type="button" class="try">Try today</button>
</div>
<div class="agent-profiles">
<h2>
Selections from the Overpass Marketplace
</h2>
<img src="./images/profiles.svg" alt="profiles">
</div>
</section>
I have a flex container, which has 2 flex containers with flex-direction: column.
You've got an invalid comment in your CSS, which is breaking your first line of code:
<!-- ***** finding container ***** -->
section.finding-container {
top: 180px;
display: flex;
flex-direction: row;
position: absolute;
justify-content:space-between;
align-items: center;
/* height: 100% */
/* margin-right: 215px; */
}
That's HTML commenting syntax. In CSS, it's invalid, so the following section.finding-container selector is seen as an error and ignored. The container then falls back to its default layout model, display: block, which stacks child elements vertically. (You can see the proper CSS commenting syntax at the bottom of your rule.)
More details about CSS commenting syntax and error handling:
Why are some of my CSS rules not working?
Initially, it displayed in 2 columns but did not start at the same height ...
You've got all sorts of margins and alignment properties (such as justify-content) set on the items and container, so they're rendering at different heights.
section.finding-container {
/* top: 180px; */
display: flex;
flex-direction: row;
position: absolute;
justify-content: space-between;
/* align-items: center; */
border: 2px dashed red; /* for illustration purposes */
padding: 10px; /* for illustration purposes */
}
.find-agent {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
/* margin-top: 350px; */
/* margin-bottom: auto; */
/* margin-left: 50px; */
border: 1px solid green; /* for illustration purposes */
}
.find-agent img,
h1,
p,
button {
display: block;
margin-left: auto;
margin-right: auto;
}
.find-agent h1 {
font-weight: 550;
color: #1E95EE;
text-align: center;
margin-top: 12px;
margin-bottom: 0;
}
.find-agent p {
color: #3A3C3E;
font-weight: 350;
width: 445px;
height: 71px;
text-align: center;
opacity: 1;
}
.try {
border: 2px solid #1E95EE;
border-radius: 5px;
opacity: 1;
color: #1E95EE;
font-size: 18px;
font-weight: Regular;
height: 50px;
width: 143px;
text-align: center;
vertical-align: middle;
text-decoration: none;
justify-content: center;
}
.agent-profiles {
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
margin-top: 0;
/* margin-bottom: auto; */
border: 1px solid black; /* for illustration purposes */
}
.agent-profiles h2,
img {
display: block;
margin-left: auto;
margin-right: auto;
}
.agent-profiles h2 {
font-weight: 350;
color: #1E95EE;
text-align: center;
width: 182px;
height: 44px;
letter-spacing: 0;
opacity: 1;
}
<section class="finding-container">
<div class="find-agent">
<img src="./images/search.svg" alt="search">
<h1>Find the perfect agent</h1>
<p>
No more browsing through thousands of applications.
Each week, we'll send you a fresh batch of hand-picked,
personally-vetted candidates.
</p>
<button type="button" class="try">Try today</button>
</div>
<div class="agent-profiles">
<h2>
Selections from the
Overpass Marketplace
</h2>
<img src="./images/profiles.svg" alt="profiles">
</div>
</section>