Why is there white space on the bottom of the web page - html

The white space is visible when I select a height over 20px at the last CSS Element. The
class "roadmap-box"
Near the bottom of the HTML Body Element. The top white box is the "roadmap-box" Click here to see the image
Whenever I try to adjust the height, the top white box becomes bigger, but also the white box at the bottom grows in size. I dont know how to fix that.
* {
margin: 0;
padding: 0;
font-family: sans-serif;
}
.banner {
width: 100%;
height: 100vh;
background-image: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.5)), url(Background/3.jpg);
background-size: cover;
background-position: center;
padding-bottom: 2100px;
}
.navbar {
width: 85%;
margin: auto;
padding: 35px 0;
display: flex;
align-items: center;
justify-content: space-between;
}
.profile-signature {
width: 300px;
object-position: top;
object-fit: contain;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
.navbar ul li {
list-style: none;
display: inline-block;
margin: 0 20px;
position: relative;
}
.navbar ul li a {
text-decoration: none;
color: #fff;
text-transform: uppercase;
}
.navbar ul li::after {
content: '';
height: 3px;
width: 0;
background: #009688;
position: absolute;
left: 0;
bottom: -10px;
transition: 0.5s;
}
.navbar ul li:hover::after {
width: 100%;
}
.profile-picture {
border-radius: 50%;
width: 150px;
height: 150px;
object-fit: cover;
cursor: pointer;
box-shadow: 16px 16px 32px rgba(255, 255, 255, 0.3), -16px -16px 32px rgba(255, 255, 255, 0.3);
transition: 0.5s;
}
.profile-picture:hover {
width: 275px;
height: 275px;
transform: translateY(-25px);
transition: 0.5s;
}
.content {
width: 100%;
position: absolute;
top: 60;
transform: translateY(25px);
text-align: center;
color: white;
}
.content h1 {
font-size: 70px;
margin-top: 60px;
}
.content p {
margin: 20px auto;
font-weight: 100;
line-height: 25px;
}
button {
width: 200px;
padding: 15px 0;
text-align: center;
margin: 20px 10px;
border-radius: 25px;
font-weight: bold;
border: 2px solid #009688;
background: transparent;
color: white;
cursor: pointer;
position: relative;
overflow: hidden;
}
span {
background: #009688;
height: 100%;
width: 0;
border-radius: 25px;
position: absolute;
left: 0;
bottom: 0;
z-index: -1;
transition: 0.5s;
}
button:hover span {
width: 100%;
}
button:hover {
border: none
}
.text-box {
height: 600px;
border: 3px;
border-style: none;
border-color: rgba(255, 255, 255, 0.3);
transform: translateY(500px);
display: flex;
justify-content: space-around;
}
.images-box1 {
background-color: rgba(68, 218, 185, 0.05);
border-radius: 77px;
width: 375px;
height: 628px;
border: 5px;
border-color: #1f534f;
border-style: solid none;
align-items: center;
cursor: pointer;
z-index: -1;
transition: 0.7s;
}
.images-box1:hover {
background: rgb(152, 152, 152);
background: linear-gradient(3deg, rgba(152, 152, 152, 0) 0%, rgba(255, 255, 255, 0.3113620448179272) 100%);
height: 300px;
margin-top: 20px;
background: #009688;
transition: 0.7s;
}
.text-image {
border-radius: 75px;
width: 375px;
height: 300px;
display: flex;
justify-content: left;
align-items: center;
flex-direction: column;
object-fit: cover;
object-position: middle;
}
.text-title-box1 {
text-align: start;
margin-top: 10px;
text-align: center;
}
p {
padding-top: 20px;
transition: 0.5s;
}
p:hover {
transition: 0.5s;
}
.bottom-parent {
position: relative;
}
.bottom {
display: block;
width: 100%;
position: absolute;
bottom: 0;
height: 45px;
background-color: rgb(21, 105, 87);
}
.text-bottom {
display: flex;
justify-content: center;
text-indent: 20px;
padding-right: 20px;
padding-top: 13px;
color: white;
}
.twitter-hover {
text-decoration: none;
color: white;
}
.twitter-hover:hover {
text-decoration: underline;
color: rgba(255, 255, 255, 0.685);
}
.linkedin-hover {
text-decoration: none;
color: white;
}
.linkedin-hover:hover {
text-decoration: underline;
color: rgba(255, 255, 255, 0.685);
}
.instagram-hover {
text-decoration: none;
color: white;
}
.instagram-hover:hover {
text-decoration: underline;
color: rgba(255, 255, 255, 0.685);
}
.impressum:hover {
cursor: pointer;
text-decoration: underline;
color: rgba(255, 255, 255, 0.685);
}
.roadmap-box {
width: 100%;
height: 50px;
background-color: white;
transform: translateY(-500px);
}
<div class="banner">
<div class="navbar">
<img class="profile-signature" src="Logo/logo-1.png" alt="Profile Logo">
<ul>
<li>HOME</li>
<li>PORTFOLIO</li>
<li>GAMES</li>
<li>SOCIALS</li>
<li>CONTACT</li>
</ul>
</div>
<div class="content">
<a href="https://google.com/" target="_blank">
<img class="profile-picture" src="Logo/logo-2.jpg" alt="Profile Picture">
</a>
<h1>WELCOME TO PARADISE!</h1>
<p>This is a practice website. There's just a bit of text here to fill the lines, blah blah blah.
<br>If you want to know more about me, just have a look around</p>
<div>
<a href="https://google.com/" target="_blank">
<button type="button" href="#middle"><span></span>PORTFOLIO</button>
</a>
<a href="https://twitter.com/" target="_blank">
<button type="button"><span></span>SOCIALS</button>
</a>
</div>
<div class="text-box">
<div class="images-box1">
<img src="designs/1.jpg" class="text-image">
<div>
<h2 class="text-title-box1">Random Design 1</h1>
<p></p>
</div>
</div>
<div class="images-box1">
<img src="designs/2.jpg" class="text-image">
<div>
<h2 class="text-title-box1">Fantasy Shower</h1>
<p>Well, nothing much to explain here. <br> <br> I need some text so have run reading <br> blah blah blah again <br> <br>:)</p>
</div>
</div>
<div class="images-box1">
<img src="designs/3.jpg" class="text-image">
<div>
<h2 class="text-title-box1">Light Bulb Girl</h1>
<p>This image was created 2020. <br> It shows a person beeing stuck inside a lightbulb. Funny right? No deeper <br> intentions, dont look for them, <br> lol</p>
</div>
</div>
<div class="images-box1">
<img src="designs/4.jpg" class="text-image">
<div>
<h2 class="text-title-box1">Random Design 4</h1>
<p>Test</p>
</div>
</div>
</div>
</div>
</div>
<div class="code-image-box">
<div class="code-image">
</div>
</div>
<div class="roadmap-box">
<div class="q1"></div>
<div class="q2"></div>
</div>
<div class="bottom-parent">
<div class="bottom">
<div class="text-bottom">
<a class="twitter-hover" href="https:/twitter.com/" target="_blank">
<div class="twitter">Twitter</div>
</a>
<a class="linkedin-hover" href="https:/linkedin.com/" target="_blank">
<div class="linkedin">LinkedIn</div>
</a>
<a class="instagram-hover" href="https:/instagram.com/" target="_blank">
<div class="instagram">Instagram</div>
</a>
<div class="impressum">Impressum</div>
</a>
</div>
</div>
</div>

The div with class .roadmap-box has been translatedY(-500px) but the browser has still made the space available for it as it's a block-level element. If you hide it then the gap disappears. What's the purpose of it? What are you trying to do with it?
See example below. There's also no need to make .bottom position:absoute as it then gives the div .bottom-parent no height. See modified markup below.
* {
margin: 0;
padding: 0;
font-family: sans-serif;
}
.banner {
width: 100%;
height: 100vh;
background-image: linear-gradient(rgba(0, 0, 0, 0.65), rgba(0, 0, 0, 0.5)), url(Background/3.jpg);
background-size: cover;
background-position: center;
padding-bottom: 2100px;
}
.navbar {
width: 85%;
margin: auto;
padding: 35px 0;
display: flex;
align-items: center;
justify-content: space-between;
}
.profile-signature {
width: 300px;
object-position: top;
object-fit: contain;
display: flex;
justify-content: center;
align-items: center;
cursor: pointer;
}
.navbar ul li {
list-style: none;
display: inline-block;
margin: 0 20px;
position: relative;
}
.navbar ul li a {
text-decoration: none;
color: #fff;
text-transform: uppercase;
}
.navbar ul li::after {
content: '';
height: 3px;
width: 0;
background: #009688;
position: absolute;
left: 0;
bottom: -10px;
transition: 0.5s;
}
.navbar ul li:hover::after {
width: 100%;
}
.profile-picture {
border-radius: 50%;
width: 150px;
height: 150px;
object-fit: cover;
cursor: pointer;
box-shadow: 16px 16px 32px rgba(255, 255, 255, 0.3), -16px -16px 32px rgba(255, 255, 255, 0.3);
transition: 0.5s;
}
.profile-picture:hover {
width: 275px;
height: 275px;
transform: translateY(-25px);
transition: 0.5s;
}
.content {
width: 100%;
position: absolute;
top: 60;
transform: translateY(25px);
text-align: center;
color: white;
}
.content h1 {
font-size: 70px;
margin-top: 60px;
}
.content p {
margin: 20px auto;
font-weight: 100;
line-height: 25px;
}
button {
width: 200px;
padding: 15px 0;
text-align: center;
margin: 20px 10px;
border-radius: 25px;
font-weight: bold;
border: 2px solid #009688;
background: transparent;
color: white;
cursor: pointer;
position: relative;
overflow: hidden;
}
span {
background: #009688;
height: 100%;
width: 0;
border-radius: 25px;
position: absolute;
left: 0;
bottom: 0;
z-index: -1;
transition: 0.5s;
}
button:hover span {
width: 100%;
}
button:hover {
border: none
}
.text-box {
height: 600px;
border: 3px;
border-style: none;
border-color: rgba(255, 255, 255, 0.3);
transform: translateY(500px);
display: flex;
justify-content: space-around;
}
.images-box1 {
background-color: rgba(68, 218, 185, 0.05);
border-radius: 77px;
width: 375px;
height: 628px;
border: 5px;
border-color: #1f534f;
border-style: solid none;
align-items: center;
cursor: pointer;
z-index: -1;
transition: 0.7s;
}
.images-box1:hover {
background: rgb(152, 152, 152);
background: linear-gradient(3deg, rgba(152, 152, 152, 0) 0%, rgba(255, 255, 255, 0.3113620448179272) 100%);
height: 300px;
margin-top: 20px;
background: #009688;
transition: 0.7s;
}
.text-image {
border-radius: 75px;
width: 375px;
height: 300px;
display: flex;
justify-content: left;
align-items: center;
flex-direction: column;
object-fit: cover;
object-position: middle;
}
.text-title-box1 {
text-align: start;
margin-top: 10px;
text-align: center;
}
p {
padding-top: 20px;
transition: 0.5s;
}
p:hover {
transition: 0.5s;
}
.bottom-parent {
position: relative;
}
.bottom {
display: block;
width: 100%;
/* position: absolute; */
bottom: 0;
height: 45px;
background-color: rgb(21, 105, 87);
}
.text-bottom {
display: flex;
justify-content: center;
text-indent: 20px;
padding-right: 20px;
padding-top: 13px;
color: white;
}
.twitter-hover {
text-decoration: none;
color: white;
}
.twitter-hover:hover {
text-decoration: underline;
color: rgba(255, 255, 255, 0.685);
}
.linkedin-hover {
text-decoration: none;
color: white;
}
.linkedin-hover:hover {
text-decoration: underline;
color: rgba(255, 255, 255, 0.685);
}
.instagram-hover {
text-decoration: none;
color: white;
}
.instagram-hover:hover {
text-decoration: underline;
color: rgba(255, 255, 255, 0.685);
}
.impressum:hover {
cursor: pointer;
text-decoration: underline;
color: rgba(255, 255, 255, 0.685);
}
.roadmap-box {
width: 100%;
height: 50px;
background-color: white;
display: none;
/*transform: translateY(-500px);*/
}
<div class="banner">
<div class="navbar">
<img class="profile-signature" src="Logo/logo-1.png" alt="Profile Logo">
<ul>
<li>HOME</li>
<li>PORTFOLIO</li>
<li>GAMES</li>
<li>SOCIALS</li>
<li>CONTACT</li>
</ul>
</div>
<div class="content">
<a href="https://google.com/" target="_blank">
<img class="profile-picture" src="Logo/logo-2.jpg" alt="Profile Picture">
</a>
<h1>WELCOME TO PARADISE!</h1>
<p>This is a practice website. There's just a bit of text here to fill the lines, blah blah blah.
<br>If you want to know more about me, just have a look around
</p>
<div>
<a href="https://google.com/" target="_blank">
<button type="button" href="#middle"><span></span>PORTFOLIO</button>
</a>
<a href="https://twitter.com/" target="_blank">
<button type="button"><span></span>SOCIALS</button>
</a>
</div>
<div class="text-box">
<div class="images-box1">
<img src="designs/1.jpg" class="text-image">
<div>
<h2 class="text-title-box1">Random Design 1</h1>
<p></p>
</div>
</div>
<div class="images-box1">
<img src="designs/2.jpg" class="text-image">
<div>
<h2 class="text-title-box1">Fantasy Shower</h1>
<p>Well, nothing much to explain here. <br> <br> I need some text so have run reading <br> blah blah blah again <br> <br>:)</p>
</div>
</div>
<div class="images-box1">
<img src="designs/3.jpg" class="text-image">
<div>
<h2 class="text-title-box1">Light Bulb Girl</h1>
<p>This image was created 2020. <br> It shows a person beeing stuck inside a lightbulb. Funny right? No deeper <br> intentions, dont look for them, <br> lol</p>
</div>
</div>
<div class="images-box1">
<img src="designs/4.jpg" class="text-image">
<div>
<h2 class="text-title-box1">Random Design 4</h1>
<p>Test</p>
</div>
</div>
</div>
</div>
</div>
<div class="code-image-box">
<div class="code-image">
</div>
</div>
<div class="roadmap-box">
<div class="q1"></div>
<div class="q2"></div>
</div>
<div class="bottom-parent">
<div class="bottom">
<div class="text-bottom">
<a class="twitter-hover" href="https:/twitter.com/" target="_blank">
<div class="twitter">Twitter</div>
</a>
<a class="linkedin-hover" href="https:/linkedin.com/" target="_blank">
<div class="linkedin">LinkedIn</div>
</a>
<a class="instagram-hover" href="https:/instagram.com/" target="_blank">
<div class="instagram">Instagram</div>
</a>
<div class="impressum">Impressum</div>
</a>
</div>
</div>
</div>

Related

How can I make my footer to meet the end of the VP

I'm trying to make a google clone page, I am trying to make the footer to be sticked to the end of the viewport. But when I try position: absolute bottom: 0, it sticks to the end, but the page overflows.
I tried to use html, body and * height: 100% but it doesn't work.
I share my github repository for you to check the code: https://github.com/Diefonro/HTML-CSS
You can also check the webpage (on a PC) at: https://diefonro.github.io/HTML-CSS/
Code:
<body>
<header>
<nav>
<div class="nav">
<div id="nav-g-i">
<a class="menu-item" href="#">Gmail</a>
<a class="menu-item" href="https://google.com/imghp">Images</a>
</div>
<div class="" id="nav-gr-a">
<div class="dd-cont">
<div class="grid">
<img
id="grid"
src="assets/icons/apps_black_24dp.svg"
alt="apps-icon"
/>
</div>
<div class="drop-d">
<div class="dd-item">
<img
id="dd-search"
src="assets/icons/google-logo-dd.png"
alt="google-search-icon"
/>
<p>Search</p>
</div>
<div class="dd-item">
<img
id="dd-maps"
src="assets/icons/google-maps-dd.png"
alt="google-maps-icon"
/>
<p>Maps</p>
</div>
<div class="dd-item">
<img
id="dd-keep"
src="assets/icons/google-keep-dd.png"
alt="google-keep-icon"
/>
<p>Keep</p>
</div>
<div class="dd-item">
<img
class="dd-drive"
src="assets/icons/Google_Drive_dd.png"
alt="google-keep-icon"
/>
<p>Drive</p>
</div>
<div class="dd-item">
<img
class="dd-calendar"
src="assets/icons/512px-Google_Calendar_icon_dd.png"
alt="google-calendar-icon"
/>
<p>Calendar</p>
</div>
<div class="dd-item">
<img
class="dd-photos"
src="assets/icons/google_photos-dd.png"
alt="google-photos-icon"
/>
<p>Photos</p>
</div>
</div>
</div>
<img
id="profile-pic"
src="assets/icons/account_circle_black_24dp.svg"
alt="account-icon"
/>
</div>
</div>
</nav>
</header>
<main>
<section>
<div class="logo-cont">
<img
id="google-logo"
src="assets/images/googlelogo_color_272x92dp.png"
alt="google-logo"
/>
</div>
<div class="input-cont">
<input class="input-g" type="text" />
<img
src="assets/icons/search_black_24dp.svg"
alt="search-icon"
class="search-i"
/>
<img
class="mic"
src="assets/icons/Google_mic.svg.png"
alt="voice-search-icon"
/>
</div>
<div class="btn-cont">
<button class="custom-btn">Google Search</button>
<button class="custom-btn custom-btn-l">I'm Feeling Lucky</button>
</div>
<span class="s-lang"
>Google offered in:
<a href="#" class="s-link"
><div class="ll">Español (Latinoamérica)</div></a
>
</span>
</section>
</main>
<footer>
<div class="footer-cont">
<div class="top-footer">
<span class="f1">Colombiac test</span>
</div>
<div class="bottom-footer">
<div class="left-footer">
<div class="a-li">
About
Advertising
Business
How Search works
</div>
</div>
<div class="right-footer">
Privacy
Terms
Settings
</div>
</div>
</div>
</footer>
</body>
* {
margin: 0;
}
html{
height: 100vh;
}
body {
font-family: Arial, sans-serif;
}
nav {
text-align: right;
position: relative;
top: 9px;
right: 8px;
}
#nav-g-i {
display: inline-block;
position: relative;
top: 2px;
right: 23px;
}
#nav-gr-a {
display: inline-block;
position: relative;
top: 5px;
right: 10px;
}
#grid,
#profile-pic {
opacity: 50%;
}
section {
text-align: center;
position: relative;
top: 24px;
}
.input-g {
position: relative;
bottom: 2px;
width: 500px;
line-height: 17px;
border: none;
outline: none;
}
.input-cont {
width: 553px;
height: 16px;
position: relative;
bottom: 2px;
right: 1px;
color: #222;
border: 1px solid #dfe1e5;
font-size: 13px;
padding: 14px;
border-radius: 80px;
margin: 24px 0px;
display: inline-block;
}
.input-cont:hover,
.input-cont:focus {
box-shadow: 0 1px 5px 0 rgba(32, 33, 36, 0.28);
border-color: rgba(40, 40, 41, 0);
}
.input-cont > img {
position: absolute;
top: 10px;
right: 11px;
width: 23px;
}
.input-cont .search-i {
position: absolute;
top: 11.5px;
right: 547px;
width: 20px;
opacity: 40%;
}
#grid {
position: relative;
bottom: 3px;
margin-right: 16px;
}
.menu-item {
font-size: 13px;
color: #5b5f63;
text-decoration: none;
position: relative;
bottom: 8px;
margin-right: 10px;
}
.menu-item:hover {
text-decoration: underline;
}
#profile-pic {
width: 32px;
height: 32px;
}
.btn-cont {
position: relative;
top: 3px;
}
.custom-btn {
background-color: #f2f2f291;
color: #a2a8af;
font-size: 14px;
height: 36px;
padding: 0 16px;
background-image: linear-gradient(top, #f5f5f5, #f1f1f1);
border: 1px solid transparent;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0);
color: #222;
border-radius: 5px;
}
.custom-btn:first-of-type {
margin-right: 7px;
}
.custom-btn:hover {
border: 1px solid #c6c6c656;
box-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
color: #222;
}
.custom-btn:active {
border: 1px solid cornflowerblue;
}
.drop-d {
width: 285px;
padding: 10px;
border: 1px solid #ccc;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
text-align: center;
position: absolute;
right: 11px;
border-radius: 12px;
display: none;
}
.grid:hover {
display: inline-block;
}
.dd-item:hover {
border: 1px solid rgba(0, 0, 0, 0.2);
border-radius: 8px;
}
.dd-item {
margin-top: 10px;
display: inline-block;
width: 70px;
padding: 6px 3px;
}
.dd-item > img {
height: 50px;
width: 50px;
}
.dd-item > p {
color: rgba(0, 0, 0, 0.87);
margin: 0;
margin-top: 15px;
margin-bottom: 5px;
}
.dd-cont {
display: inline-block;
}
.dd-cont:hover .drop-d {
display: block;
}
.s-lang {
font-size: 13px;
color: #333;
position: relative;
top: 30px;
right: 3px;
}
.s-lang a {
text-decoration: underline;
}
.s-lang a:visited {
color: rgb(30, 30, 179);
}
.ll {
display: inline-block;
position: relative;
left: 3px;
}
.top-footer,
.bottom-footer {
font-size: 15px;
background-color: #d6d8da49;
color: #8a8686;
position: relative;
top: 200px;
}
.top-footer{
border-bottom: 1px solid rgba(155, 155, 155, 0.267);
}
.left-footer a {
display: inline-block;
text-decoration: none;
padding: 12px;
font-size: 14px;
}
.right-footer a {
font-size: 14px;
padding: 14px;
text-decoration: none;
color: #8a8686;
}
.bottom-footer{
display: flex;
justify-content: space-between;
align-items: center;
}
.bottom-footer a:hover{
text-decoration: underline;
}
span.f1 {
display: inline-block;
margin-left: 15px;
padding: 16px;
}
.a-li {
margin-left: 20px;
}
a:visited {
color: inherit;
}
.footer-cont {
position: absolute;
bottom: 0;
width: 100%;
left: 0;
height: fit-content;
height: -moz-fit-content;
}
footer{
position: relative;
width: 100vw;
}
You can remove top: 200px on .top-footer, .bottom-footer. Why? because you have added bottom: 0 to .footer-cont which increases its position to 0 (.footer-cont) + 200px (.top-footer, .bottom-footer) = 200px down. If scroll bars in vertical bother you, you can add overflow-y: hidden style to body or html.

Why can't i align the div that contains text next to the div that contains the image

i'm currently working on a webpage for my design class and i have a problem. This is the browser view:
I am kinda new with html and css but i have tried display in-line block, flex... Nothing worked, and i dont know what else i could do
So the problem is that the text "aaaaa" must be next to image. Here is my html code:
.caixa {
word-wrap: break-word;
width: 70%;
box-shadow: 2px 2px 30px rgba(0, 0, 0, 0.2);
margin: 25px;
margin-left: 0px;
border-radius: 10px;
}
.caixa-img {
display: inline-block;
margin: 15px;
width: 15%;
position: relative;
}
.caixa-img img {
margin-right: 120px;
border-radius: 10px;
width: 100%;
height: 100%;
}
.info {
width: 100%;
padding: 10px 20px;
}
.tipo {}
.descripcio {
display: block;
background-color: chartreuse;
}
.tipo a {
color: #222222;
margin: 5px 0px;
font-weight: 700;
letter-spacing: 0.5px;
padding-right: 8px;
}
.tipo span {
color: rgba(26, 26, 26, 0.5);
}
.preu {
color: #333333;
font-weight: 600;
font-size: 1.1rem;
font-family: poppins;
letter-spacing: 0.5px;
}
.overlay {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 100%;
background-color: rgba(226, 197, 88, 0.6);
display: flex;
justify-content: center;
align-items: center;
}
.comprar {
width: 160px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
background-color: #FFFFFF;
color: #252525;
font-weight: 700;
letter-spacing: 1px;
font-family: calibri;
border-radius: 20px;
box-shadow: 2px 2px 30px rgba(0, 0, 0, 0.2);
}
.comprar:hover {
color: #FFFFFF;
background-color: rgb(248, 171, 55);
transition: all ease 0.3s;
}
.overlay {
visibility: hidden;
}
.caixa-img:hover .overlay {
visibility: visible;
animation: fade 0.5s;
}
#keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
<div class="col-12 productes">
<div class="producte1">
<div class="caixa">
<div class="caixa-img">
<img alt="" src="imgExplora/imgCarrousel/herbicida.jpg">
<div class="overlay">
Comprar
</div>
<div class="tipo">
<a href="#">
<h3>HERBICIDA</h3>
</a>
<!--
<div class="rating">
<span>☆</span><span>☆</span><span>☆</span><span>☆</span><span>☆</span>
</div>-->
</div>
55€
</div>
<div class="info">
<span class="descripcio">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</span>
</div>
</div>
</div>
</div>
Below an example using flexbox (see .caixa).
.caixa {
width: 70%;
box-shadow: 2px 2px 30px rgba(0, 0, 0, 0.2);
margin: 25px 25px 25px 0;
/* margin-left: 0px; */
border-radius: 10px;
display: flex; /* Added */
}
.caixa-img {
margin: 15px;
width: 30%;
}
.caixa-img img {
border-radius: 10px;
width: 125px; /* For demo */
height: 125px; /* For demo */
}
.info {
width: 100%;
padding: 10px 20px;
}
.tipo {}
.descripcio {
display: block;
background-color: chartreuse;
word-break: break-all; /* Essential to break large words */
}
.tipo a {
color: #222222;
margin: 5px 0px;
font-weight: 700;
letter-spacing: 0.5px;
padding-right: 8px;
}
.tipo span {
color: rgba(26, 26, 26, 0.5);
}
.preu {
color: #333333;
font-weight: 600;
font-size: 1.1rem;
font-family: poppins;
letter-spacing: 0.5px;
}
.overlay {
position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
width: 100%;
height: 100%;
background-color: rgba(226, 197, 88, 0.6);
display: flex;
justify-content: center;
align-items: center;
}
.comprar {
width: 160px;
height: 40px;
display: flex;
justify-content: center;
align-items: center;
background-color: #FFFFFF;
color: #252525;
font-weight: 700;
letter-spacing: 1px;
font-family: calibri;
border-radius: 20px;
box-shadow: 2px 2px 30px rgba(0, 0, 0, 0.2);
}
.comprar:hover {
color: #FFFFFF;
background-color: rgb(248, 171, 55);
transition: all ease 0.3s;
}
.overlay {
visibility: hidden;
}
.caixa-img:hover .overlay {
visibility: visible;
animation: fade 0.5s;
}
#keyframes fade {
0% {
opacity: 0;
}
100% {
opacity: 1;
}
}
<div class="col-12 productes">
<div class="producte1">
<div class="caixa">
<div class="caixa-img">
<img alt="" src="imgExplora/imgCarrousel/herbicida.jpg">
<div class="overlay">
Comprar
</div>
<div class="tipo">
<a href="#">
<h3>HERBICIDA</h3>
</a>
</div>
55€
</div>
<div class="info">
<span class="descripcio">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</span>
</div>
</div>
</div>
</div>
if you use boostrap framework
you can use the bootstrap column and row.
<!-- language: lang-html -->
<div class="row">
<div class="col-6 productes">
<div class="producte1">
<div class="caixa">
<div class="caixa-img">
<img alt="" src="imgExplora/imgCarrousel/herbicida.jpg">
<div class="overlay">
Comprar
</div>
</div>
<div class="col-6">
<div class="tipo">
<a href="#">
<h3>HERBICIDA</h3>
</a>
<!--
<div class="rating">
<span>☆</span><span>☆</span><span>☆</span><span>☆</span><span>☆</span>
</div>-->
</div>
55€
</div>
<div class="info">
<span class="descripcio">aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</span>
</div>
</div>
</div>
</div>
</div>
<!-- end snippet -->
You have too much nested divs that dont need to be there, just making it more complex.
Also, your text is going outside your div borders, this is not a good thing.
You can move your text next to the image by using flex.
You always apply flex on a parent of the element that you want to move around (in this case, div with a picture, and div with a text).
So you are going to apply flex to a div that holds both of those divs (div with image, and div with text).
Here is my solution to this problem on a simple example, it should help you :
https://codepen.io/Juka99/pen/YzGVQyv

how to get circular menu (incl. hover + link functionality) fully responsive?

I am trying to get a circular menu (incl. hover + link functionality) to behave fully responsible.
The hovering and linking part basically is working fine.
Without the hovering part, the circular menu behaves responsive.
But with the hovering part included, the menu gets squeezed when display/screen width is adjusted.
I have tried the #media approach, setting different width and height in .ch-grid li for different screen widths, but that is not to be considered as a true solution, is merely a temporary workaround.
ul,
li {
list-style: none;
margin: 0;
padding: 0;
}
#test1 {
display: -webkit-flex;
display: flex;
text-align: center;
justify-content: space-between;
margin-bottom: 30px;
margin-left: 35px;
margin-right: 35px;
}
#test2 {
width: 15%;
text-align: center;
position: relative;
border-radius: 50%;
overflow: hidden;
background-color: #ff0082;
}
ul li img {
position: absolute;
width: 100%;
height: 100%;
top: 0;
left: 0;
object-fit: cover;
}
.ch-grid:after,
.ch-item:before {
content: '';
display: table;
}
.ch-grid:after {
clear: both;
}
.ch-grid li {
width: 220px;
height: 90px;
display: inline-block;
}
.ch-item {
width: 100%;
height: 100%;
border-radius: 50%;
overflow: hidden;
position: relative;
cursor: default;
box-shadow: inset 0 0 0 16px rgba(255, 255, 255, 0.6), 0 1px 2px rgba(0, 0, 0, 0.1);
transition: all 0.4s ease-in-out;
}
.ch-info {
position: absolute;
background: rgba(63, 147, 147, 0.8);
width: inherit;
height: inherit;
border-radius: 50%;
overflow: hidden;
opacity: 0;
transition: all 0.4s ease-in-out;
transform: scale(0);
}
.ch-info p {
color: #fff;
padding: 13px 0px;
font-style: normal;
font-size: 9px;
border-top: 1px solid rgba(255, 255, 255, 0.5);
opacity: 0;
transition: all 1s ease-in-out 0.4s;
}
.ch-info p a {
display: block;
color: rgba(255, 255, 255, 0.7);
font-style: normal;
font-weight: 700;
font-size: 140%;
letter-spacing: 1px;
padding-top: 4px;
font-family: 'Open Sans', Arial, sans-serif;
}
.ch-info p a:hover {
color: rgba(255, 242, 34, 0.8);
}
.ch-item:hover {
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1), 0 1px 2px rgba(0, 0, 0, 0.1);
}
.ch-item:hover .ch-info {
transform: scale(1);
opacity: 1;
}
.ch-item:hover .ch-info p {
opacity: 1;
}
<ul id="test1" class="ch-grid">
<li id="test2">
<div class="ch-item">
<img src="https://gespreksmakers.nl/images/1_hansie_hansumus.jpg" />
<div class="ch-info">
<p>Hansie<BR>Hansumus</p>
</div>
</div>
</li>
<li id="test2">
<div class="ch-item">
<img src="https://gespreksmakers.nl/images/1_missie_marble.jpg" />
<div class="ch-info">
<p>Missie<BR>Marble</p>
</div>
</div>
</li>
<li id="test2">
<div class="ch-item">
<img src="https://gespreksmakers.nl/images/1_piotr_linski.jpg" />
<div class="ch-info">
<p>Piotr<BR>Linski</p>
</div>
</div>
</li>
<li id="test2">
<div class="ch-item">
<img src="https://gespreksmakers.nl/images/1_red.jpg" />
<div class="ch-info">
<p>Mister<BR>Red</p>
</div>
</div>
</li>
<li id="test2">
<div class="ch-item">
<img src="https://gespreksmakers.nl/images/1_green.jpg" />
<div class="ch-info">
<p>Miss<BR>Green</p>
</div>
</div>
</li>
<li id="test2">
<div class="ch-item">
<img src="https://gespreksmakers.nl/images/1_blue.jpg" />
<div class="ch-info">
<p>Mister<BR>Blue</p>
</div>
</div>
</li>
</ul>
A fiddle, showing the present CSS- and HTML-code can be found here: https://jsfiddle.net/piotrlinski/b3tL9v4h/8/
Any suggestions how to solve?
The class attribute can be used with multiple HTML elements/tags and
all will take the effect. Where as the id is meant for a single
element/tag and is considered unique. Moreoever the id has a higher
specificity value than the class.
Responsive image:
.img-responsive {
display: block;
max-width: 100%;
height: auto;
}
An unordered list:
<ul class="thumbnails">
<li>Thumbnail 1</li>
<li>Thumbnail 2</li>
<li>...</li>
</ul>
List unstyled in one line with display: flex:
.thumbnails {
display: flex;
list-style: none;
...
}
Structure of a thumbnail
<a href="https://nkbv.nl" class="thumbnail">
<img src = "https://gespreksmakers.nl/images/1_hansie_hansumus.jpg"/>
<div class="overlay">
<p class="text">Mister White</p>
</div>
</a>
where .thumbnail has position: relative and .overlay has position: absolute so that .overlay is in the same area as .thumbnail.
Make font size responsive with vw.
A modified and clear solution
.thumbnails {
display: flex;
list-style: none;
padding: 0 2vw;
}
.thumbnails>li {
flex: 1 0;
margin: 0 5px;
text-align: center;
line-height: 0;
}
.thumbnail,
.thumbnail>img,
.thumbnail>.overlay {
border-radius: 50%;
}
.thumbnail {
position: relative;
display: inline-block;
cursor: pointer;
}
/* Responsive images */
.thumbnail>img {
display: block;
max-width: 100%;
height: auto;
}
.thumbnail>.overlay {
background: rgba(63, 147, 147, 0.8);
opacity: 0.7;
position: absolute;
top: 0;
height: 100%;
width: 100%;
transform: scale(0);
display: flex;
flex-direction: column;
justify-content: center;
text-align: center;
transition: all 0.4s ease-in-out;
}
.thumbnail>.overlay>.text {
color: white;
width: 66.66%;
line-height: 100%;
margin: 0 auto;
padding: 5px 0;
border-bottom: 1px solid;
border-top: 1px solid;
font-size: 1.85vw;
transition: opacity 1s ease-in-out 0.4s;
opacity: 0;
}
.thumbnail:hover>.overlay {
transform: scale(1);
}
.thumbnail:hover>.overlay>.text {
opacity: 1;
}
<ul class="thumbnails">
<li>
<a href="https://nkbv.nl" class="thumbnail">
<img src="https://gespreksmakers.nl/images/1_hansie_hansumus.jpg" />
<div class="overlay">
<p class="text">Mister White</p>
</div>
</a>
</li>
<li>
<a href="https://kakivi.de" class="thumbnail">
<img src="https://gespreksmakers.nl/images/1_missie_marble.jpg" />
<div class="overlay">
<p class="text">Mister White</p>
</div>
</a>
</li>
<li>
<a href="https://telegraaf.nl" class="thumbnail">
<img src="https://gespreksmakers.nl/images/1_piotr_linski.jpg" />
<div class="overlay">
<p class="text">Mister White</p>
</div>
</a>
</li>
<li>
<a href="https://www.tukhut.nl" class="thumbnail">
<img src="https://gespreksmakers.nl/images/1_red.jpg" />
<div class="overlay">
<p class="text">Mister White</p>
</div>
</a>
</li>
<li>
<a href="https://www.alumnei.nl" class="thumbnail">
<img src="https://gespreksmakers.nl/images/1_green.jpg" />
<div class="overlay">
<p class="text">Mister White</p>
</div>
</a>
</li>
<li>
<a href="https://www.astronieuws.nl" class="thumbnail">
<img src="https://gespreksmakers.nl/images/1_blue.jpg" />
<div class="overlay">
<p class="text">Mister White</p>
</div>
</a>
</li>
</ul>
You may check my code below though I have made kind of lots of changes.
Some tips:
IDs must be unique in the HTML document, so you should not use an ID more than once (e.g. #test2).
Also, it is better to use the classes you created to style your document, rather than the IDs (e.g. #test1, #test2 could be replaced by .ch-grid and .ch-grid li, respectively).
<style>
ul,
li {
list-style: none;
margin: 0;
padding: 0;
}
.ch-grid {
display: -webkit-flex;
display: flex;
flex-wrap: wrap;
text-align: center;
}
.ch-grid:after,
.ch-item:before {
content: "";
display: table;
}
.ch-grid:after {
clear: both;
flex: auto;
}
.ch-grid li {
flex: 1;
display: inline-block;
min-width: calc(100% / 6);
max-width: calc(100% / 6);
position: relative;
background-color: #ff0082;
overflow: hidden;
border-radius: 50%;
text-align: center;
}
.ch-grid li img {
width: 100%;
height: 100%;
object-fit: cover;
position: relative;
z-index: 10;
}
.ch-item {
position: relative;
width: 100%;
height: 100%;
border-radius: 50%;
overflow: hidden;
cursor: default;
box-shadow: inset 0 0 0 16px rgba(255, 255, 255, 0.6),
0 1px 2px rgba(0, 0, 0, 0.1);
transition: all 0.3s ease-in-out;
}
.ch-info {
position: absolute;
top: 0;
left: 0;
width: 100%;
height: 100%;
display: -webkit-flex;
display: flex;
flex-direction: column;
justify-content: center;
background: rgba(63, 147, 147, 0.8);
border-radius: 50%;
overflow: hidden;
opacity: 0;
transition: all 0.4s ease-in-out;
transform: scale(0);
z-index: 20;
}
.ch-info p {
color: #fff;
padding: 13px 0px;
font-style: normal;
font-size: 9px;
border-top: 1px solid rgba(255, 255, 255, 0.5);
opacity: 0;
transition: all 1s ease-in-out 0.4s;
}
.ch-info p a {
display: block;
color: rgba(255, 255, 255, 0.7);
font-style: normal;
font-weight: 700;
font-size: 140%;
letter-spacing: 1px;
padding-top: 4px;
font-family: "Open Sans", Arial, sans-serif;
}
.ch-info p a:hover {
color: rgba(255, 242, 34, 0.8);
}
.ch-item:hover {
box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1),
0 1px 2px rgba(0, 0, 0, 0.1);
}
.ch-item:hover .ch-info {
transform: scale(1);
opacity: 1;
}
.ch-item:hover .ch-info p {
opacity: 1;
}
#media (max-width: 767px) {
.ch-grid li {
min-width: calc(100% / 3);
max-width: calc(100% / 3);
}
}
</style>
If you set width over percentage, the list items will not seem as a circle depending the screen width. Because of this situation, you should set fixed width to the list items and set wrap to parent as you can see below:
#test1 {
display: -webkit-flex;
display: flex;
text-align: center;
justify-content: space-between;
flex-wrap: wrap;
margin-bottom: 30px;
margin-left: 35px;
margin-right: 35px;
}
#test2 {
flex-basis: 85px;
text-align: center;
position: relative;
border-radius: 50%;
overflow: hidden;
background-color: #ff0082;
}

Cannot reduce div height without having visualization issues

in this codepen:https://codepen.io/anon/pen/GGrVdK
I cannot reduce the height of the div having class foul-row to 4px height, given that every foul div is 4px tall.
.foul{
background: linear-gradient(to bottom right, rgb(0,0,0), rgb(92,92,92));
height: 4px;
margin-top:0;
margin-bottom: 0;
margin-right: 2px;
width: 15px;
display: inline-block;
}
If I try to set a height to foul-row class, either I have scrollbars in the containing cell div, or I can't see foul divs.
Here there is cell class
.cell{
padding: 6px 8px 0 8px;
white-space: nowrap;
font-size: 13px;
min-width: 27px;
display: block;
overflow: auto;
height: 36px; /*I would like to remove this, but if I do, I have visualization problems*/
}
and this is the structure of the "incriminated" cell
<div class="cell white">
<div>Home Team</div>
<div class="foul-row">
<div class="foul"></div><div class="foul"></div><div class="foul">/div><div class="foul"></div><div class="foul"></div>
</div>
</div>
How can I reduce foul-row height to fit foul height and reduce the total height of cell div? Thanks
Your height:4px is being overriteen by the font-size, which is by default 16px,because it needs to have space for the text to show up.
Now since div.foul doesn't have any text it will be fine to set it's font to 0.
body {
font-family: 'Fjalla One', sans-serif;
text-transform: uppercase;
letter-spacing: 0.02em;
/* background-image: url(https://dynamitick.com/wp-content/uploads/2018/01/legnano-basket-19-sempione-news.jpg); */
background-position: center;
background-repeat: no-repeat;
background-size: cover;
height: 100%;
}
.red {
background-color: rgba(255, 0, 0, 0.7);
color: white;
}
.blue {
background-color: rgba(0, 0, 255, 0.7);
color: white
}
.black {
background-color: rgba(0, 0, 0, 0.7);
color: white;
}
.green {
background-color: rgba(0, 128, 0, 0.7);
color: white;
}
.yellow {
background-color: rgba(255, 255, 0, 0.7);
color: blue;
}
.white {
background-color: rgba(255, 255, 255, 0.7);
color: blue;
}
.grey {
background-color: rgba(128, 128, 128, 0.7);
color: white;
}
.score {
text-align: right;
}
.cell {
padding: 6px 8px 0 8px;
/* display: inline-flex; */
/* overflow: auto; */
white-space: nowrap;
font-size: 13px;
min-width: 27px;
/* min-height: 16px; */
display: block;
overflow: auto;
height: 36px;
/* text-overflow: ellipsis */
}
.shadow {
background: linear-gradient(rgba(255, 255, 255, 1), rgba(0, 0, 0, 1), rgba(255, 255, 255, 1));
}
.column {
display: inline-block;
height: 100%;
}
.separator {
display: inline-block;
width: 1px;
}
.timer {
/* width: 60px; */
text-align: center;
}
.container {
border-radius: 10px;
overflow: hidden;
display: table;
clear: both;
font-size: 0;
animation-name: rotation;
animation-duration: 1s;
border: 1px solid grey;
}
#keyframes rotation {
from {
transform: rotateX(90deg);
}
to {
transform: rotateX(0deg);
}
}
.bottom-left {
position: absolute;
bottom: 3vh;
left: 2vh;
}
.bottom-right {
position: absolute;
bottom: 3vh;
right: 2vh;
}
.top-right {
position: absolute;
top: 3vh;
right: 2vh;
}
.top-left {
position: absolute;
top: 3vh;
left: 2vh;
}
.message-title {
text-align: center;
}
.message-body {
text-align: center;
min-width: 150px;
background-color: rgba(0, 0, 0, 0.66);
color: white;
text-transform: none
}
.half-shadow-up {
background: linear-gradient(rgba(255, 255, 255, 1), rgba(128, 128, 128, 1));
}
.tv-logo img {
max-width: 150px;
max-height: 150px;
margin: auto;
}
.foul {
background: linear-gradient(to bottom right, rgb(0, 0, 0), rgb(92, 92, 92));
height: 4px;
margin-top: 0;
margin-bottom: 0;
font-size: 0;
margin-right: 2px;
width: 15px;
display: inline-block;
}
.foul-row {
height: 4px;
}
<link href="https://fonts.googleapis.com/css?family=Fjalla+One" rel="stylesheet">
<div class="container shadow top-right">
<div class="column timer">
<div class="cell red"><span>00:00</span></div>
<div class="cell red">Q4</div>
</div>
<div class="separator"></div>
<div class="column">
<div class="cell white">
<div>Home Team</div>
<div class="foul-row">
<div class="foul"></div>
<div class="foul"></div>
<div class="foul"></div>
<div class="foul"></div>
<div class="foul"></div>
</div>
</div>
<div class="cell green">
<div>Guest team</div>
<div class="foul-row">
<div class="foul"></div>
<div class="foul"></div>
<div class="foul"></div>
<div class="foul"></div>
<div class="foul"></div>
</div>
</div>
</div>
<div class="separator"></div>
<div class="column score">
<div class="cell white">
100
</div>
<div class="cell green">
65
</div>
</div>
</div>
<div class="container bottom-left">
<div class="column">
<div class="cell white half-shadow-up message-title">
10 A. Player
</div>
<div class="cell message-body">
24 pts, 8 reb
</div>
</div>
</div>
Please try adding your height:4px to foul-row after changing the overflow property on your cell element to hidden:
.cell{
padding: 6px 8px 0 8px;
white-space: nowrap;
font-size: 13px;
min-width: 27px;
display: block;
overflow: hidden; /* changed */
height: 36px;
}

Dealing with textarea height crossbrowser

I'm trying to absolute position a button underneath a textarea, I have some content next to the button I'd like to have it not push down.
html {
background: #1f252e;
color: white;
font-family: sans-serif;
}
.commentForm {
position: relative;
}
.textInput {
padding: 10px;
background: rgba(0, 0, 0, 0.08);
border: solid 1px rgba(255, 255, 255, 0.05);
position: relative;
border-radius: 2px;
height: 55px;
overflow: hidden;
z-index: 1;
}
.textInput__input {
color: white;
width: 100%;
resize: none;
font-size: 14px;
font-family: 'Roboto', sans-serif;
background: transparent;
margin: 0px;
outline: none;
border: none;
display: block;
}
.textInput:hover {
cursor: text;
background: rgba(255, 255, 255, 0.05);
}
.formField.hasErrors .wd-input {
border-color: #e43e22;
}
.wd-form__footer {
margin-top: 15px;
display: flex;
}
.formField__error {
margin-top: 15px;
font-size: 13px;
color: #e43e22;
}
.wd-button--primary {
background: rgba(0, 0, 0, 0.25);
height: 35px;
min-width: 50px;
padding: 10px;
position: relative;
border-radius: 2px;
overflow: hidden;
z-index: 1;
font-size: 14px;
}
.wd-button {
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
box-sizing: border-box;
}
.wd-form__status {
flex-grow: 1;
}
.commentForm__actions {
position: absolute;
top: 90px;
right: 0px;
}
<div class="commentForm wd-form">
<div class="form">
<div class="formField hasErrors" style="max-width: 100%;">
<div class="textInput wd-input ">
<textarea rows="3" class="textInput__input" placeholder="Type a comment..."></textarea>
</div>
<div class="formField__error">15 more characters to go...</div>
</div>
<div class="wd-form__footer">
<div class="wd-form__status">
<div class="formStatus"></div>
</div>
<div class="commentForm__actions wd-form__actions">
<a role="button" class="wd-button wd-button--primary">
<div class="wd-button__label">Post comment</div>
</a>
</div>
</div>
</div>
</div>
Now, in Firefox and Chrome I get very different results.
In Chrome the button is aligned properly:
But in firefox, the button is clipping with the textarea:
This is because the text area height is different in Firefox than it is in Chrome. How do I fix this?
I tend to stay away from position: absolute if I can. You can instead use float: right and a negative margin.
html {
background: #1f252e;
color: white;
font-family: sans-serif;
}
.commentForm {
position: relative;
}
.textInput {
padding: 10px;
background: rgba(0, 0, 0, 0.08);
border: solid 1px rgba(255, 255, 255, 0.05);
position: relative;
border-radius: 2px;
height: 55px;
overflow: hidden;
z-index: 1;
}
.textInput__input {
color: white;
width: 100%;
resize: none;
font-size: 14px;
font-family: 'Roboto', sans-serif;
background: transparent;
margin: 0px;
outline: none;
border: none;
display: block;
}
.textInput:hover {
cursor: text;
background: rgba(255, 255, 255, 0.05);
}
.formField.hasErrors .wd-input {
border-color: #e43e22;
}
.wd-form__footer {
margin-top: -15px;
}
.formField__error {
margin-top: 15px;
font-size: 13px;
color: #e43e22;
}
.wd-button--primary {
background: rgba(0, 0, 0, 0.25);
height: 35px;
min-width: 50px;
padding: 10px;
position: relative;
border-radius: 2px;
overflow: hidden;
z-index: 1;
font-size: 14px;
}
.wd-button {
display: -webkit-inline-box;
display: -webkit-inline-flex;
display: -ms-inline-flexbox;
display: inline-flex;
box-sizing: border-box;
}
.wd-form__status {
flex-grow: 1;
}
.commentForm__actions {
position: absolute;
top: 90px;
right: 0px;
}
<div class="commentForm wd-form">
<div class="form">
<div class="formField hasErrors" style="max-width: 100%;">
<div class="textInput wd-input ">
<textarea rows="3" class="textInput__input" placeholder="Type a comment..."></textarea>
</div>
<div class="formField__error">15 more characters to go...</div>
</div>
<div class="wd-form__footer">
<div class="wd-form__status">
<div class="formStatus"></div>
</div>
<div class="commentForm__actions wd-form__actions">
<a role="button" class="wd-button wd-button--primary">
<div class="wd-button__label">Post comment</div>
</a>
</div>
</div>
</div>
</div>