Hello developers, today in this blog, you'll learn how to create a Responsive Contact Form using HTML & CSS.
After the visitor fills this form, they can give submit button which will send the information to the owner of the site. The details filled by the visitor in the form will be received by the owner of the site.
In this program (Responsive Contact Form), on the webpage, the linear background is used. To make the contact form responsive, we have used the CSS media query property. The Subject text box in this contact form is adjustable.
The source code of this Responsive Contact Form is given below, if you want the source code of this program, you can copy it. You can use this Responsive Contact Form with your creativity and can take this project to the next level.
Responsive Contact Form using HTML & CSS [Source Code]
To make this website, you would like to make two files: an HTML file & a CSS file. First, create an HTML file with the name of index.html and remember, you have to create a file with a .html extension.
* {
box-sizing: border-box;
}
body{
background-color: #85FFBD;
background-image: linear-gradient(45deg, #85FFBD 0%, #FFFB7D 100%);
font-family: 'Franklin Gothic Medium', 'Arial Narrow', Arial, sans-serif;
}
input[type=text], select, textarea {
width: 100%;
padding: 12px;
border: 1px solid #85FFBD;
border-radius: 4px;
resize: vertical;
color:#fff;
background-color: transparent;
}
input[type=email] {
width: 100%;
padding: 12px;
border: 1px solid #85FFBD;
border-radius: 4px;
resize: vertical;
color:#fff;
background-color: transparent;
}
label {
padding: 12px 12px 12px 0;
display: inline-block;
}
input[type=submit] {
background-color: #85FFBD;
background-image: linear-gradient(45deg, #85FFBD 0%, #FFFB7D 100%);
color: #000;
padding: 12px 20px;
border: none;
border-radius: 6px;
cursor: pointer;
float: right;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
input[type=submit]:hover {
background-color: #45a049;
}
.container {
border-radius: 10px;
background-color: #202124;
padding: 20px;
max-width:800Px;
margin: 85px auto;
color:#fff;
box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
}
.col-25 {
float: left;
width: 25%;
margin-top: 6px;
}
.col-75 {
float: left;
width: 75%;
margin-top: 6px;
}
/* Clear floats after the columns */
.row:after {
content: "";
display: table;
clear: both;
}
/* Responsive layout - when the screen is less than 600px wide, make the two columns stack on top of each other instead of next to each other */
@media screen and (max-width: 600px) {
.col-25, .col-75, input[type=submit] {
width: 100%;
margin-top: 0;
}
}
.credit{
text-align: center;
color: #000;
font-weight: 900;
font-family: 'Trebuchet MS', 'Lucida Sans Unicode', 'Lucida Grande', 'Lucida Sans', Arial, sans-serif;
}
.credit a{
text-decoration: none;
color:#202124;
font-weight: bold;
}
Thank you for reading our blog. If you face any problem in creating this Responsive Contact Form using HTML & CSS, then contact us or comment us. We’ll try to provide a solution to your problem as soon as possible.
Post a Comment
Thank you
Learning robo team