Unable to create a web layout design - html

I am unable to create a web layout I am using only HTML and CSS . Kindly help me out here
my code :
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
section {
min-height: 100vh;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #fddcc356;
}
.container {
width: 90%;
max-width: 600px;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
}
.img_part {
width: 40%;
height: 250px;
background: url(images/hat.jpg) no-repeat center/cover;
border-radius: 8px;
position: relative;
}
.text_part {
width: 50%;
min-height: 550px;
background-color: black;
display: flex;
justify-content: center;
align-items: center;
padding: 30px;
border-radius: 8px;
color: white;
margin-left: -20px;
}
.text_part h1 {
font-size: 40px;
font-weight: lighter;
}
.text_part p {
margin: 20px 0;
line-height: 25px;
font-weight: 500;
}
.text_part a {
text-decoration: none;
color: black;
padding: 20px 30px;
letter-spacing: 2px;
display: inline-block;
text-transform: uppercase;
background-color: white;
position: absolute;
}
.behind_part {
min-width: 25%;
min-height: 100px;
background-color: brown;
position: absolute;
border: 2px solid red;
margin-right: 350px;
margin-top: -350px;
}
<section>
<div class="container">
<div class="img_part"></div>
<div class="text_part">
<div class="content">
<h1>French girl</h1>
<h1>Summer Outfit</h1>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt.
</p>
Learn More
</div>
</div>
<div class="behind_part"></div>
</div>
</section>
My Output :
The actual output:
Problem: The main problem here is that I cannot move the brown container behind the image as it completely covers my image . I want to show brown container behind the image such that it does not cover the face of the image.
Although I manage to do the task 90% how can I tackle this problem.

The z-index property in CSS specifies how elements overlap each other.
The z-index CSS property sets the z-order of a positioned element and its descendants or flex items. Overlapping elements with a larger z-index cover those with a smaller one.
MDN Docs
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
section {
min-height: 100vh;
width: 100%;
display: flex;
justify-content: center;
align-items: center;
background-color: #fddcc356;
}
.container {
width: 90%;
max-width: 600px;
margin: 0 auto;
display: flex;
justify-content: center;
align-items: center;
}
.img_part {
width: 40%;
height: 250px;
background: url(https://via.placeholder.com/200) no-repeat center/cover;
border-radius: 8px;
position: relative;
}
.text_part {
width: 50%;
min-height: 550px;
background-color: black;
display: flex;
justify-content: center;
align-items: center;
padding: 30px;
border-radius: 8px;
color: white;
margin-left: -20px;
}
.text_part h1 {
font-size: 40px;
font-weight: lighter;
}
.text_part p {
margin: 20px 0;
line-height: 25px;
font-weight: 500;
}
.text_part a {
text-decoration: none;
color: black;
padding: 20px 30px;
letter-spacing: 2px;
display: inline-block;
text-transform: uppercase;
background-color: white;
position: absolute;
}
.behind_part {
min-width: 25%;
min-height: 150px;
background-color: brown;
position: absolute;
border: 2px solid red;
margin-right: 350px;
margin-top: -350px;
z-index: -999;
}
<section>
<div class="container">
<div class="img_part"></div>
<div class="text_part">
<div class="content">
<h1>French girl</h1>
<h1>Summer Outfit</h1>
<p>Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non proident, sunt in culpa qui officia deserunt.
</p>
Learn More
</div>
</div>
<div class="behind_part"></div>
</div>
</section>
Adding z-index: -999; to the image will make it move to the back.

Related

Carousel code scrolls across screen #media 800px

I was wondering how would I get the boxes not to clash with one another in mobileview.
I have included all the code into mobile view, but certain boxes clash with one another how do I get it not to clash? I have how ever tried using just one line of code but it still would clash into one another.
Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse cillum dolore eu fugiat nulla pariatur.
.scroll-parent {
position: relative;
width: 100vw;
height: 20rem;
overflow-x: hidden;
}
.scroll-element {
width: inherit;
height: inherit;
position: absolute;
left: 0%;
top: 0%;
animation: primary 15s linear infinite;
}
#keyframes primary {
from {
left: 0%;
}
to {
left: -100%;
}
}
.primary {
animation: primary 15s linear infinite;
}
.secondary {
animation: secondary 15s linear infinite;
}
#keyframes primary {
from {
left: 0%;
}
to {
left: -100%;
}
}
#keyframes secondary {
from {
left: 100%;
}
to {
left: 0%;
}
}
.wrapper{
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}
.wrapper .carousel{
display: flex;
justify-content: space-between;
padding: 0 30px;
}
.wrapper .card{
background: #e74c3c;
line-height: 250px;
text-align: center;
color: #fff;
font-size: 90px;
width: 280px;
font-weight: 600;
margin: 20px 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0,0,0,.2);
pointer-events: none;
}
.wrapper .card{
display: flex;
justify-content: space-around;
position: relative;
left: 185px;
animation: carousel 5s linear infinite;
}
.carousel .card .cards{
overflow: hidden;
}
.carousel .card.cards-2{
background: #3498db;
}
.carousel .card.cards-3{
background: #16a085;
}
.carousel .card.cards-4{
background: #2c3e50;
}
.carousel .card.cards-5{
background: #630460;
}
#media only screen and (max-width: 800px){
.scroll-parent {
position: relative;
width: 100vw;
height: 20rem;
overflow-x: hidden;
}
.scroll-element {
width: inherit;
height: inherit;
position: absolute;
left: 0%;
top: 0%;
animation: primary 15s linear infinite;
}
#keyframes primary {
from {
left: 0%;
}
to {
left: -100%;
}
}
.primary {
animation: primary 15s linear infinite;
}
.secondary {
animation: secondary 15s linear infinite;
}
#keyframes primary {
from {
left: 0%;
}
to {
left: -100%;
}
}
#keyframes secondary {
from {
left: 100%;
}
to {
left: 0%;
}
}
.wrapper{
display: flex;
justify-content: center;
align-items: center;
overflow: hidden;
}
.wrapper .carousel{
display: flex;
justify-content: space-between;
padding: 0 30px;
}
.wrapper .card{
background: #e74c3c;
line-height: 250px;
text-align: center;
color: #fff;
font-size: 90px;
width: 280px;
font-weight: 600;
margin: 20px 20px;
border-radius: 8px;
box-shadow: 0 4px 8px rgba(0,0,0,.2);
pointer-events: none;
}
.wrapper .card{
display: flex;
justify-content: space-around;
position: relative;
left: 185px;
animation: carousel 5s linear infinite;
}
.carousel .card .cards{
overflow: hidden;
}
.carousel .card.cards-2{
background: #3498db;
}
.carousel .card.cards-3{
background: #16a085;
}
.carousel .card.cards-4{
background: #2c3e50;
}
.carousel .card.cards-5{
background: #630460;
}
}
<div class="scroll-parent">
<div class="scroll-element primary">
<div class="wrapper">
<div class="carousel">
<div class="card cards-1">A</div>
<div class="card cards-2">B</div>
<div class="card cards-3">C</div>
<div class="card cards-4">D</div>
<div class="card cards-5">E</div>
</div>
</div>
</div>
<div class="scroll-element secondary">
<div class="wrapper">
<div class="carousel">
<div class="card cards-1">A</div>
<div class="card cards-2">B</div>
<div class="card cards-3">C</div>
<div class="card cards-4">D</div>
<div class="card cards-5">E</div>
</div>
</div>
</div>
</div>

Navigation bar obscures headings

I am creating a resume site, and I ran into a problem that the navigation bar blocks the title, that is, it looks like this https://prnt.sc/ggkfkwSV8KUp, and I need so https://prnt.sc/oX0Hw2G_d_xk.
I tried to indent, but the navbar follows this title and obscures it all the time, no matter how indented I am, how can I fix this? I added code here, (yes, the styles here are not very, not adapted, I know) I removed a lot of code, left only two sections to show, but the fact is that it doesn’t work like mine, more precisely in a small form works like mine, but if you expand it to the whole page, then the navbar does not block the title, but it fits a little, but it can still be shown using this example.
body {
margin: 0;
}
.header {
position: fixed;
width: 100%;
height: 50px;
background: #212121;
z-index: 2;
}
h1 {
margin: 50px;
margin-top: 1px;
float: left;
font-family: cursive;
background-image: linear-gradient(to right, #E55D87 0%, #5FC3E4 51%, #E55D87 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
h2 {
margin-top: 50px;
}
.navbar {
text-transform: uppercase;
line-height: 18px;
height: 50px;
float: right;
}
li {
display:inline-block;
margin:0;
text-transform:uppercase;
}
li:after {
display: block;
content: '';
border-bottom: 1px solid aqua;
transform: scaleX(0);
transition: transform 250ms ease-in-out;
}
li:hover::after {
transform: scaleX(1);
}
.button {
text-decoration: none;
background-image: linear-gradient(to right, #E55D87 0%, #5FC3E4 51%, #E55D87 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-family: cursive;
margin: 10px;
cursor: pointer;
font-size: 20px;
transition: 0.5s;
background-size: 200% auto;
}
.button:hover {
background-position: right center;
}
.my-photo {
position: relative;
border-radius: 50%;
height: 180px;
width: 180px;
padding: 0;
margin-top: 300px;
object-fit: cover;
z-index: -1;
margin-left: 700px;
margin-top: 150px;
}
.h2 {
font-size: 50px;
background: #19CFB1;
background: linear-gradient(to right, #19CFB1 0%, #C978CF 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-align: center;
font-family: cursive;
}
#text {
background: #1338CF;
background: linear-gradient(to right, #1338CF 0%, #CF70AF 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 50px;
margin: 0;
font-size: 25px;
text-align: center;
font-family: cursive;
}
.home-image {
position: absolute;
background-size: cover;
background-position: center center;
width: 100%;
height: 100vh;
z-index: -1;
margin-bottom: -10px;
background-image: url("./img/foto-mustang-6-shelby-gt500_01.jpg")
}
.home-image::after {
content: '';
width: 100%;
height: 100%;
position: absolute;
top: 0; left: 0;
background-color: rgba(0,0,0,0.7);
}
blockquote {
text-align: center;
margin: 0;
color: white;
padding: 30px 30px 30px 60px;
font-family: 'Lato', sans-serif;
font-weight: 300;
}
blockquote:before {
content: "\201C";
font-family: Arial;
color: #CBDDE7;
font-size: 50px;
position: absolute;
left: 362px;
top: 596px;
z-index: -1;
}
blockquote p {
font-style: italic;
font-size: 20px;
margin-top: 130px;
}
.about {
padding: 20px 0;
}
#about{
width: 1300px;
height: 687px;
padding: 0 80px;
margin: auto;
}
.title {
position: relative;
text-align: center;
font-size: 40px;
font-weight: 500;
margin-bottom: 26px;
padding-bottom: 20px;
font-family: cursive;
z-index: -1;
}
.title::before {
content: "";
position: absolute;
bottom: 0px;
left: 50%;
width: 180px;
height: 3px;
background: #111;
transform: translateX(-50%);
}
.title::after {
content: "who i am";
font-family: 'Ubuntu', sans-serif;
position: absolute;
bottom: -8px;
left: 50%;
font-size: 20px;
color: crimson;
padding: 0 5px;
background: #fff;
transform: translateX(-50%);
}
.content {
display: flex;
align-items: center;
justify-content: space-between;
}
.image {
height: 500px;
width: 350px;
margin-left: 5px;
margin-top: 50px;
object-fit: cover;
border-radius: 15px;
}
.column-right {
width: 55%;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 18px;
text-align: justify;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="./img/icon.png" type="image/x-icon">
<link rel="stylesheet" href="./style.css">
<title>CV</title>
</head>
<body>
<header class="header">
<ul class="navbar">
<li>Home</li>
<li>About Me</li>
<li>Portfolio</li>
<li>Contact Me</li>
</ul>
<h1>My CV</h1>
</header>
<section class="home" id="home">
<div class="wrapper">
<div class="home-header home-header-small">
<div class="home-image"></div>
<div class="container">
<div class="content-center">
<div class="profile-image">
<img src="" class="my-photo"/>
</div>
<div class="h2">Lorem ipsum</div>
<p id="text">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
</div>
<blockquote>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
<footer>— <cite>Lorem ipsum</cite></footer>
</blockquote>
</div>
</div>
</section>
<section class="about" id="about">
<h2 class="title">About me</h2>
<div class="content">
<img src="" class="image"/>
<div class="column-right">
<div class="text">Lorem ipsum</div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit minus impedit maxime, quae soluta quis cumque perferendis! Doloribus quaerat, placeat iste facere, aspernatur ex cum veritatis laudantium, officia, non porro exercitationem incidunt quis dolore? Officia ex accusamus expedita optio, voluptatem minus? In maiores omnis aperiam earum ab molestiae beatae laborum blanditiis incidunt, delectus dolor, id voluptates optio aspernatur aliquam saepe atque labore?</p>
</div>
</div>
</section>
Another options is to use
.header {
position: sticky;
top: 0;
}
/* or, instead*/
.navbar {
position: sticky;
top: 0;
}
body {
margin: 0;
}
.header {
position: sticky;
top: 0px;
width: 100%;
height: 50px;
background: #212121;
z-index: 2;
}
h1 {
margin: 50px;
margin-top: 1px;
float: left;
font-family: cursive;
background-image: linear-gradient(to right, #E55D87 0%, #5FC3E4 51%, #E55D87 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
}
h2 {
margin-top: 50px;
}
.navbar {
text-transform: uppercase;
line-height: 18px;
height: 50px;
float: right;
}
li {
display:inline-block;
margin:0;
text-transform:uppercase;
}
li:after {
display: block;
content: '';
border-bottom: 1px solid aqua;
transform: scaleX(0);
transition: transform 250ms ease-in-out;
}
li:hover::after {
transform: scaleX(1);
}
.button {
text-decoration: none;
background-image: linear-gradient(to right, #E55D87 0%, #5FC3E4 51%, #E55D87 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
font-family: cursive;
margin: 10px;
cursor: pointer;
font-size: 20px;
transition: 0.5s;
background-size: 200% auto;
}
.button:hover {
background-position: right center;
}
.my-photo {
position: relative;
border-radius: 50%;
height: 180px;
width: 180px;
padding: 0;
margin-top: 300px;
object-fit: cover;
z-index: -1;
margin-left: 700px;
margin-top: 150px;
}
.h2 {
font-size: 50px;
background: #19CFB1;
background: linear-gradient(to right, #19CFB1 0%, #C978CF 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
text-align: center;
font-family: cursive;
}
#text {
background: #1338CF;
background: linear-gradient(to right, #1338CF 0%, #CF70AF 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
line-height: 50px;
margin: 0;
font-size: 25px;
text-align: center;
font-family: cursive;
}
.home-image {
position: absolute;
background-size: cover;
background-position: center center;
width: 100%;
height: 100vh;
z-index: -1;
margin-bottom: -10px;
background-image: url("./img/foto-mustang-6-shelby-gt500_01.jpg")
}
.home-image::after {
content: '';
width: 100%;
height: 100%;
position: absolute;
top: 0; left: 0;
background-color: rgba(0,0,0,0.7);
}
blockquote {
text-align: center;
margin: 0;
color: white;
padding: 30px 30px 30px 60px;
font-family: 'Lato', sans-serif;
font-weight: 300;
}
blockquote:before {
content: "\201C";
font-family: Arial;
color: #CBDDE7;
font-size: 50px;
position: absolute;
left: 362px;
top: 596px;
z-index: -1;
}
blockquote p {
font-style: italic;
font-size: 20px;
margin-top: 130px;
}
.about {
padding: 20px 0;
}
#about{
width: 1300px;
height: 687px;
padding: 0 80px;
margin: auto;
}
.title {
position: relative;
text-align: center;
font-size: 40px;
font-weight: 500;
margin-bottom: 26px;
padding-bottom: 20px;
font-family: cursive;
z-index: -1;
}
.title::before {
content: "";
position: absolute;
bottom: 0px;
left: 50%;
width: 180px;
height: 3px;
background: #111;
transform: translateX(-50%);
}
.title::after {
content: "who i am";
font-family: 'Ubuntu', sans-serif;
position: absolute;
bottom: -8px;
left: 50%;
font-size: 20px;
color: crimson;
padding: 0 5px;
background: #fff;
transform: translateX(-50%);
}
.content {
display: flex;
align-items: center;
justify-content: space-between;
}
.image {
height: 500px;
width: 350px;
margin-left: 5px;
margin-top: 50px;
object-fit: cover;
border-radius: 15px;
}
.column-right {
width: 55%;
font-family:'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
font-size: 18px;
text-align: justify;
}
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="shortcut icon" href="./img/icon.png" type="image/x-icon">
<link rel="stylesheet" href="./style.css">
<title>CV</title>
</head>
<body>
<header class="header">
<ul class="navbar">
<li>Home</li>
<li>About Me</li>
<li>Portfolio</li>
<li>Contact Me</li>
</ul>
<h1>My CV</h1>
</header>
<section class="home" id="home">
<div class="wrapper">
<div class="home-header home-header-small">
<div class="home-image"></div>
<div class="container">
<div class="content-center">
<div class="profile-image">
<img src="" class="my-photo"/>
</div>
<div class="h2">Lorem ipsum</div>
<p id="text">Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
</div>
</div>
<blockquote>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit.</p>
<footer>— <cite>Lorem ipsum</cite></footer>
</blockquote>
</div>
</div>
</section>
<section class="about" id="about">
<h2 class="title">About me</h2>
<div class="content">
<img src="" class="image"/>
<div class="column-right">
<div class="text">Lorem ipsum</div>
<p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Fugit minus impedit maxime, quae soluta quis cumque perferendis! Doloribus quaerat, placeat iste facere, aspernatur ex cum veritatis laudantium, officia, non porro exercitationem incidunt quis dolore? Officia ex accusamus expedita optio, voluptatem minus? In maiores omnis aperiam earum ab molestiae beatae laborum blanditiis incidunt, delectus dolor, id voluptates optio aspernatur aliquam saepe atque labore?</p>
</div>
</div>
</section>

Placing a transparent div with borders on top of another transparent div with borders

Please see the image below.
contact-image
I want to make a contact container that has a square Contact header. I want the contact header in the middle of the container halfway out of the container. Problem is, both the header and the container have to be transparent and they have borders. The borders of the container cut right through the contact header. I'm having trouble removing the borders from inside the header.
<style>* {
margin: 0;
padding: 0;
box-sizing: border-box;
font-size: 100%;
}
body {
display: flex;
align-items: center;
justify-content: center;
padding-top: 30px;
padding-bottom: 20px;
}
.profile {
width: 480px;
display: flex;
flex-direction: column;
justify-content: space-between;
}
ul {
list-style-type: none;
}
li {
display: inline;
}
.contact {
margin-bottom: 5px;
}
.container {
border: 2px solid gray;
}
.contact {
width: 40%;
margin-top: -23px;
border: 2px solid gray;
}
.header {
display: flex;
align-items: center;
justify-content: center;
}
h2 {
font-size: 25px;
text-align: center;
margin-top: 5px;
margin-bottom: 5px;
}
.container {
height: 380px;
}
.content {
width: 400px;
height: 70%;
margin: 0 auto;
}
.social {
display: flex;
align-items: center;
justify-content: center;
}
</style>
<div class="profile">
<section class="container">
<div class="header">
<div class="contact">
<h2>Contact</h2>
</div>
</div>
<div class="content">
<p class="about">Lorem ipsum dolor sit, amet consectetur adipisicing elit. Recusandae distinctio libero repudiandae consequatur qui, vel ad error animi doloremque magni cupiditate officia officiis et? Vel voluptatem reiciendis placeat cumque officiis!</p>
</div>
<div class="social">
<ul>
<li>Twitter</li>
<li>Behance</li>
<li>Instagram</li>
</ul>
</div>
</section>
</div>
Just use <fieldset> and <legend>.
the legend is a title in a fieldset and the border of a fieldset will not go through the legend. The legend can be aligned with the margin.
fieldset {
border: 2px solid black;
min-height: 50vh;
}
legend {
border: 2px solid black;
margin: 0 auto;
padding: 5px 20px;
}
<fieldset>
<legend>Contact</legend>
</fieldset>
Adapted from another answer, you could try this instead of border-top:
body {
background: url('https://picsum.photos/536/354');
background-size: cover;
}
.header {
width: 240px;
border: 4px solid gray;
height: 50px;
margin: auto;
position: relative;
top: 25px;
padding: 10px;
text-align: center;
}
.box {
width: 350px;
height: 100px;
position: relative;
margin: auto;
border-left: 4px solid gray;
border-right: 4px solid gray;
border-bottom: 4px solid gray;
padding: 20px;
}
.box:after {
content: '';
width: 60px;
height: 4px;
background: gray;
position: absolute;
top: 0px;
left: 0;
}
.box:before {
content: '';
width: 60px;
height: 4px;
background: gray;
position: absolute;
top: 0px;
right: 0;
}
<div class="header">
title
</div>
<div class="box">
content
</div>

How I need to use after style with tailwind?

I'm using tailwind css, but I want to import some cards that I saw in a video. I know that I can use in class the after: attribute by tailwind, but its a waste of time when I already have it on css.
This cards are working perfectly without tailwind, but when I add the tailwind CSS a part of the :after is not working. I tried adding !important to the attributes but it still doesn't work.
How it shows with tailwind:
How it shows without tailwind:
My code:
.container {
position: relative;
display: flex;
flex-wrap: wrap;
justify-content: space-between;
transform: skewY(-10deg);
}
.container .card {
position: relative;
width: 300px;
height: 400px;
background: white;
transition: 0.5s;
}
.container .card:before {
content: "";
position: absolute;
top: -15px;
left: 0;
width: 100%;
height: 15px;
background-color: #ddc700;
transform-origin: bottom;
transform: skewX(45deg);
transition: 0.5s;
}
.container .card:after {
content: "";
position: absolute;
top: -15px;
left: -15px;
width: 15px;
height: 50%;
background-color: #ddc700;
transform-origin: left;
transform: skewY(45deg);
transition: 0.5s;
border-bottom: 200px solid #d9d9d9;
}
.container .card:hover {
transform: translateY(-40px);
}
.container .card .imgBx {
position: relative;
width: 300px;
height: 200px;
background-color: #c6b200;
display: flex;
align-items: center;
flex-direction: column;
}
.container .card .imgBx img {
max-width: 100px;
}
.container .card .imgBx h3 {
position: relative;
color: black;
margin-top: 10px;
}
.container .card .content {
position: relative;
width: 100%;
height: 200px;
padding: 20px;
color: black;
background: white;
text-align: center;
}
.container .card .content:before {
content: "";
position: absolute;
left: 0;
bottom: 0;
width: 100%;
height: 400px;
background: linear-gradient(transparent, transparent, gray);
transform-origin: bottom;
transform: skewX(45deg);
transition: 0.5s;
z-index: -1;
}
.container .card:hover .content:before {
transform: translateY(40px) skewX(45deg);
filter: blur(5px);
opacity: 0.5;
}
.container .card:nth-child(1) {
z-index: 3;
}
.container .card:nth-child(2) {
z-index: 2;
}
.container .card:nth-child(3) {
z-index: 1;
}
#media (max-width: 414px) {
body {
overflow: auto;
}
.card {
width: 80%;
margin-bottom: 50px;
}
.container {
padding-top: 200px;
position: relative;
left: 15%;
top: 80%;
}
.container .card {
padding-bottom: 40px;
}
.container .card:hover {
transform: translateY(-25px);
}
}
<head>
<!-- Styles -->
<script src="https://cdn.tailwindcss.com"></script>
</head>
<body class="flex flex-col h-screen bg-black">
<div class="flex justify-center items-center text-center min-h-screen align-middle py-5 mb-3">
<div class="container">
<div class="card">
<div class="imgBx">
<h3>PUMP & DUMP</h3>
<br/>
<img src="https://i.gyazo.com/4f57be20b3be56b44ee2e6f1f13f4bc4.png" alt=""/>
</div>
<div class="content">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit quidem
cupiditate ullam animi fuga impedit odio dignissimos ab cum?
</div>
</div>
<div class="card">
<div class="imgBx">
<h3>PREVENTAS</h3>
<br/>
<img src="https://i.gyazo.com/4f57be20b3be56b44ee2e6f1f13f4bc4.png" alt=""/>
</div>
<div class="content">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit quidem
cupiditate ullam animi fuga impedit odio dignissimos ab cum?
</div>
</div>
<div class="card">
<div class="imgBx">
<h3>PASIVOS</h3>
<br/>
<img src="https://i.gyazo.com/4f57be20b3be56b44ee2e6f1f13f4bc4.png" alt=""/>
</div>
<div class="content">
Lorem ipsum dolor sit amet consectetur adipisicing elit. Velit quidem
cupiditate ullam animi fuga impedit odio dignissimos ab cum?
</div>
</div>
</div>
</div>
</body>
</html>
Your problem is the height was only 50%
You need to make it like this
.container .card:after {
content: "";
position: absolute;
top: -15px;
left: -15px;
width: 15px;
height: 100%; /*Should change here from 50% to 100%*/
background-color: #ddc700;
transform-origin: left;
transform: skewY(45deg);
transition: 0.5s;
border-bottom: 200px solid #d9d9d9;
}

Width of element not increasing to max-width

In the snippet below, I have assigned a max-width of 400px to the tooltip. It width it has is much less than that. Why doesn't the tooltip have 400px width?
I do not want to explicitly assign it 400px as width because if the content is low, it should have 120px as the width (which is the min-width).
body {
display: flex;
justify-content: center;
height: 100vh;
align-items: center;
}
.select {
position: relative;
height: 30px;
background: black;
color: white;
padding: 10px 20px;
line-height: 30px;
}
.tooltip {
display: none;
}
.tooltip:after {
position: absolute;
bottom: 100%;
left: 100%;
margin-bottom: 30px;
margin-left: -20px;
display: block;
content: attr(title);
background: red;
color: white;
line-height: 16px;
font-size: 14px;
padding: 12px;
min-width: 120px;
max-width: 400px;
}
.tooltip:before {
position: absolute;
bottom: 100%;
left: 100%;
content: '';
height: 0;
width: 0;
border-top: 6px solid red;
border-bottom: 6px solid transparent;
border-left: 9px solid red;
border-right: 9px solid transparent;
margin-left: -20px;
margin-bottom: 21px;
}
.tooltip.active {
display: block;
}
<div class="select">
<div class="tooltip active" title="Lorem ipsum dolor sit amet, consectetur adipisicing elit. Tempora quam, voluptatem aliquam quos, soluta nostrum repellat unde magni voluptatibus placeat vitae numquam voluptatum ab temporibus id illo. Voluptatem, iusto, incidunt?"></div>
I have a tooltip
</div>