<body>
<div class="container">
<img src="https://images.unsplash.com/photo-1555116505-38ab61800975?ixlib=rb-1.2.1&ixid=eyJhcHBfaWQiOjEyMDd9&auto=format&fit=crop&w=675&q=80" alt="A library.">
<main>
<h1>It's going down for real.</h1>
<p>Lorem ipsum, dolor sit amet consectetur adipisicing elit. Excepturi eveniet magni ab eos consectetur sunt, eius consequator vitae dignissimos reiciendis repellat, cupiditate qui necessitatibus voluptatibus minus dolorum modi et? <br> Nihil! </p>
<h2>About you</h2>
<!-- Form -->
<div class="contactForm">
<form action="/submit.php">
<div class="flex-parent">
<label for="fname" class="child">First Name</label>
<input type="text" class="child" id="fname" name="firstname" placeholder="Jane">
<label for="lname" class="child">Last Name</label>
<input type="text" class="child" id="lname" name="lastname" placeholder="Doe">
</div>
<div class="flex-parent">
<label for="book">Type of Book Choice</label>
<select id="book" name="book">
<option value="hardcover">Hardcover</option>
<option value="paperback">Paperback</option>
<option value="ebook">eBook</option>
</select>
</div>
<div class="flex-parent">
<label for="phone">Phone Number</label>
<input type="text" id="phone" name="phonenum" placeholder="555-555-5555">
<input type="submit" value="Send">
</div>
</form>
</div>
<!-- ./Form -->
</main>
<!-- ./main -->
</div>
<!-- ./container -->
</body>
</html>
/* font-family: 'Open Sans', sans-serif; */
* {
font-family: 'Open Sans', sans-serif;
}
.flex-parent {
display: flex;
flex-flow: wrap;
height: 100%;
padding-bottom: 12px;
}
.child {
width: 45%;
padding: 0px 3px;
}
.child:nth-child(1) {
order: 1;
margin-right: 22px;
}
.child:nth-child(2) {
order: 3;
margin-right: 16px;
}
.child:nth-child(3) {
order: 2;
}
.child:nth-child(4) {
order: 4;
margin-right: 0px;
}
.clearfix {
clear: both;
}
h1 {
font-size: 75px;
margin: 0;
padding-top: 16px;
}
h2 {
font-size: 24px;
}
p {
font-size: 16px;
font-weight: 500;
color: #9c9c9c;
line-height: 1.7;
padding-right: 60px;
}
body {
padding: 0;
margin: 0;
}
.container {
width: 100%;
padding-top: 0px;
margin-top: 0px;
}
main {
width: 45vw;
float: left;
padding: 0px 0px 0px 32px;
}
img {
width: 50vw;
float: left;
background-image: url(https://ibb.co/mgYawx);
background-repeat: no-repeat;
background-size: contain;
}
/* Form */
input[type=text], select {
padding: 5px;
margin: 4px 12px 4px 0px;
display: inline-block;
border: 1.5px solid #9c9c9c;
border-radius: 7px;
outline: none;
font-size: 14px;
}
input[type=text]:hover {
border: 2px solid #9c9c9c;
}
input[type=submit] {
width: 75px;
/* better for mobile and desktop */
background-color: black;
color: white;
font-size: 16px;
padding: 11px;
margin: 8px 0px;
border: none;
border-radius: 4px;
cursor: pointer;
transition: ease-in-out 0.5s;
}
input[type=submit]:hover {
background-color: #9c9c9c;
color: black;
}
label {
font-weight: 600;
}
select:hover {
border: 2px solid #9c9c9c;
outline: none;
}
#book {
background: white;
display: block;
padding: 5px;
width: 100%;
}
#phone {
display: block;
width: 100%;
}
/* ./ Form */
@media (max-width: 576px) {
main {
width: 90%;
}
img {
width: 100vw;
}
.child, #book, #phone {
width: 80%;
}
.child:nth-child(1) {
order: unset;
margin-right: 0px;
}
.child:nth-child(2) {
order: unset;
margin-right: 0px;
}
.child:nth-child(3) {
order: unset;
}
.child:nth-child(4) {
order: unset;
margin-right: 0px;
}
@media (max-width: 992px) and (min-width: 576px) {
img {
width: 100vw;
}
main {
padding: 0px 30px;
clear: both;
width: 90%;
}
}
This Pen doesn't use any external CSS resources.
This Pen doesn't use any external JavaScript resources.