JSFiddle - React, Tailwind, and code Playground
HTML
<div id="request_info_layer_wrapper">
<div id="request_info_layer" class="content_wrapper">
<input type="button" id="request_info_layer_button" onclick="showForm()" value="REQUEST INFORMATION" />
</div>
</div>
<div id="request_info_form_layer_wrapper">
<div id="request_info_form_wrapper">
<form name="request_info" id="request_info_form" action="/somepage" method="post">
<h3>Name</h3>
<input type="text" id="name_input" /><br />
<p>Preferred method of contact</p>
<h3>Email</h3>
<input type="text" id="email_input" /><br /><br />
<h3>Phone</h3>
<input type="text" id="phone_input" /><br /><br />
<p>Thanks for your interest in our program. We'll only use your contact information to send additional materials to help you understand the program better.</p>
<input type="submit" id="submit_button" value="SUBMIT" />
</form>
</div>
</div>
CSS
.content_wrapper {
position: relative;
width: 100%;
max-width: 1200px;
margin: 0 auto;
}
#request_info_layer_wrapper {
width: 100%;
border-bottom: solid 3px #002855;
margin-bottom: 0;
}
#request_info_layer {
position: relative;
height: 180px;
}
#request_info_layer_button {
position: absolute;
top: 48px;
left: calc(50% - 222px);
width: 100%;
max-width: 440px;
height: 82px;
background-color: #D7823C;
font-size: 35px;
color: #fff;
text-align: center;
line-height: 220%;
border-bottom: solid 4px #DFBC81;
border-left: solid 3px #DFBC81;
border-top: 0;
border-right: 0;
cursor: pointer;
}
#request_info_form_layer_wrapper {
display: none;
position: relative;
margin-top: 0;
width: 100%;
height: 585px;
background-color: #1B2857;
overflow: auto;
}
#request_info_form_wrapper {
position: relative;
width: 288px;
margin-left: calc(50% - 144px);
}
#request_info_form {
color: #fff;
font-family: verdana;
font-size: 16px;
}
#request_info_form h3 {
margin-bottom: 10px;
font-weight: normal;
}
#request_info_form input {
background-color: #1B2857;
border: 2px solid #336699;
width: 284px;
height: 25px;
}
#request_info_form input:focus {
border-color: #fff;
}
#request_info_form input[type=submit] {
color: #fff;
font-size: 20px;
height: 50px;
border-radius: 5px;
border-color: #fff;
}
JavaScript
function showForm() {
var isdisplayed = document.getElementById("request_info_form_layer_wrapper").style.display;
if (isdisplayed == "none") {
document.getElementById("request_info_form_layer_wrapper").style.display = "block";
document.getElementById("request_info_layer_button").style.borderBottom = "0";
document.getElementById("request_info_layer_button").style.borderLeft = "0";
document.getElementById("request_info_layer_button").style.borderTop = "solid 3px #C4591B";
document.getElementById("request_info_layer_button").style.borderRight = "solid 4px #C4591B";
} else {
document.getElementById("request_info_form_layer_wrapper").style.display = "none";
document.getElementById("request_info_layer_button").style.borderTop = "0";
document.getElementById("request_info_layer_button").style.borderRight = "0";
document.getElementById("request_info_layer_button").style.borderLeft = "solid 3px #DFBC81";
document.getElementById("request_info_layer_button").style.borderBottom = "solid 4px #DFBC81";
}
}