JSFiddle - React, Tailwind, and code Playground
by dhavaljani
HTML
<section>
<div class="content">
<div class="overlay-items">
<div class="logo">
<img src="https://placehold.it/160x40/?text=logo" />
</div>
<div class="login-form">
<p>
Click here to login
</p>
<form>
<label>Name</label>
<input type="text" />
</form>
</div>
<div class="text-content">
<h1>
Heading goes here and can be longer aaa aa ad
</h1>
<p>
Body copy goes here this is adkdjakljd akfj dlskjer erj ewlkjessdlk fdklsdkfj wekltjeklje kl
</p>
</div>
</div>
<div class="first">
<img src="https://placeimg.com/1024/480/nature" />
</div>
<div class="second">
<img src="https://placeimg.com/1024/480/arch" />
</div>
</div>
</section>
CSS
body {
background: #999;
}
section {
position: relative;
width: 100%;
margin-left: auto;
margin-right: auto;
background: #888;
max-width: 1024px;
}
section .first,
section .second {
width: 100%;
height: 480px;
color: #fff;
box-sizing: border-box;
overflow: hidden;
}
.overlay-items {
display: block;
float: left;
color: #fff;
z-index: 2;
font-family: Sans-serif;
padding: 20px;
width: 100%;
box-sizing: border-box;
}
.logo {
width: 50%;
text-align: center;
margin-left: 50%;
}
.login-form,
.text-content {
width: 50%;
display: inline-block;
}
.text-content {
float: left;
}
@media only screen and (max-width: 600px) {
.login-form,
.text-content {
width: 80%;
display: block;
margin-left: auto;
margin-right: auto;
float: none;
}/*
.login-form {
float: none !important;
}*/
.logo {
margin-left: 0;
width: 100%;
}
}
.login-form {
background: #fff;
color: #333;
padding: 20px;
box-sizing: border-box;
}
section .first,
section .second,
section .overlay-items {
position: absolute;
}
.first {
display: block;
/*background-image: url('https://placeimg.com/1024/480/nature');*/
background-size: cover;
background-position: center;
}
.second {
display: block;
/*background-image: url('https://placeimg.com/1024/480/arch');*/
background-size: cover;
background-position: center;
}
.second {
animation-name: fade;
animation-timing-function: ease-in-out;
animation-iteration-count: infinite;
animation-duration: 5s;
animation-direction: alternate;
}
@keyframes fade {
0% {
opacity: 1;
}
25% {
opacity: 1;
}
75% {
opacity: 0;
}
100% {
opacity: 0;
}
}