Bootstrap snippet and html example. write your message contact form

Bootstrap 5.2.0 snippet "write your message contact form" with HTML, CSS, and JS. Copy, paste, and customize this responsive UI component for your project.
Tags: contact,form

HTML code

Clean, semantic HTML that powers this Bootstrap 5.2.0 snippet. Copy and paste it into your page (with Bootstrap loaded) to reproduce the exact layout shown in the preview.

<link href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css" rel="stylesheet" />
<section id="contact" class="contact_us section-padding">
	<div class="container">
		<div class="row">
			<div class="col-lg-8 col-sm-12 col-xs-12">
				<div class="contact">
					<h4>Write Your Message </h4>
					<p>It is a long established fact that a reader will be distracted by the readable content of a page when looking at its layout.</p>
					<form class="form" name="enq" method="post" action="contact.php" onsubmit="return validation();">
						<div class="row">
							<div class="form-group col-md-6">
								<input type="text" name="name" class="form-control" placeholder="Name" required="required">
							</div>
							<div class="form-group col-md-6">
								<input type="email" name="email" class="form-control" placeholder="Email" required="required">
							</div>
							<div class="form-group col-md-12">
								<input type="text" name="subject" class="form-control" placeholder="Subject" required="required">
							</div>
							<div class="form-group col-md-12">
								<textarea rows="6" name="message" class="form-control" placeholder="Your Message" required="required"></textarea>
							</div>
							<div class="col-md-12 text-center">
								<button type="submit" value="Send message" name="submit" id="submitButton" class="btn btn-lg contact_btn" title="Submit Your Message!">Touch here</button>
							</div>
						</div>
					</form>
				</div>
			</div><!-- END COL  -->	
			<div class="col-lg-4 col-sm-12 col-xs-12">	
				<div class="address_bg">
					<div class="single_address">
						<div class="address_br"><span class="fa fa-map"></span></div>
						<h4>Address</h4>
						<p>3481 Melrose Place, Beverly Hills</p>
					</div>							
					<div class="single_address">
						<div class="address_br"><span class="fa fa-mobile"></span></div>
						<h4>Phone</h4>
						<p>+512 513 96324</p>
					</div>	
					<div class="single_address">
						<div class="address_br"><span class="fa fa-envelope"></span></div>
						<h4>Email</h4>
						<p>[email protected]</p>
					</div>
					<div class="single_address">
						<div class="address_br"><span class="fa fa-clock-o"></span></div>
						<h4>Working Hours</h4>
						<p>Mon to Sat 9:00am to 5:00pm</p>
					</div>
				</div>
			</div><!-- END COL  -->					
		</div><!-- END ROW -->
	</div><!-- END CONTAINER -->
</section>

CSS code

Scoped CSS that styles the component. Paste it after Bootstrap 5.2.0 to keep the design, spacing, and responsiveness consistent.

body{margin-top:20px;}
.contact_us{background:#fffaf1;}
.contact {margin-right:30px;}
@media only screen and (max-width:768px) { 
.contact {margin-bottom:60px;margin-right:0px;}
}
.contact h4 {font-weight: 700;font-size: 40px;}
.contact p {
margin-bottom:40px;
}
.contact input {
    background: #fff;
	border: 2px rgba(27,194,108,0.08);
	border-radius: 0px;
	box-shadow: none;
	color: #1d293e;
	font-size: 16px;
	font-weight: 400;
	height: 70px;
	padding: 10px 10px 10px 30px;
	width: 100%;
	border: 1px solid #e9e6e6;
}
.contact textarea {
	background: #fff;
	border: 2px rgba(27,194,108,0.08);
	border-radius: 0px;
	box-shadow: none;
	color: #1d293e;
	font-size: 16px;
	font-weight: 400;
	padding: 10px 10px 10px 30px;
	width: 100%;
	border: 1px solid #e9e6e6;
}
.contact input:focus {
	border: 1px solid #554c86 ;
    box-shadow: none;
    outline: 0 none;
}
.contact textarea:focus {
border: 1px solid #554c86 ;
    box-shadow: none;
    outline: 0 none;
}
.contact button {
	width: 100%;
	font-size: 16px;
}

.address_bg {
	background: #fff;
	padding: 40px;
	box-shadow: 0 10px 40px -10px rgba(0,64,128,.1);
	border-radius: 3px;
}
.single_address {
	margin-bottom: 30px;
	border-bottom: 1px solid #eee;
	padding-bottom: 30px;
}
.single_address:last-child {
	border-bottom: 0px;
	margin-bottom: 0;
	padding-bottom: 0px;
}
@media only screen and (max-width:768px) { 
.single_address{margin-bottom: 70px;}
}
.address_br{
float:left;
}
.single_address span {
	color: #554c86;
	font-size: 30px;
	margin-bottom: 20px;
	display: block;
	margin-right:20px;
}
.single_address h4 {
	font-weight: 600;
	font-size: 18px;
	overflow: hidden;
	
}
.single_address p{overflow: hidden;}
.contact_btn {
	background: #554c86;
	padding: 10px;
	color: #fff;
	text-transform: capitalize;
	-webkit-transition: 0.3s;
	transition: 0.3s;
}
.contact_btn:hover{background:#0aa1d6;color: #fff;}


.map{}
.map iframe{
width:100%;
height:500px;
margin-bottom: -8px;
}

.form-group {
    margin-bottom: 1rem;
}

Similar snippets

Bootstrap example and template. Contact list label

Contact list label

Bootstrap example and template. Login form with background image

Login form with background image

Bootstrap example and template. bs4 contact cards

bs4 contact cards

Bootstrap example and template. Textarea with character count

Textarea with character count

Bootstrap example and template. bs5 dark footer

bs5 dark footer

Bootstrap example and template. Products View List

Products View List

Bootstrap example and template. User list cards

User list cards

Bootstrap example and template. bs4 simple search result

bs4 simple search result

FAQ

How do I use this snippet?

Include Bootstrap 5.2.0, paste the HTML, add the CSS block, and include the JS (if any) to mirror the live preview.

Can I use it in commercial projects?

Yes. It’s free for personal and commercial work; check the snippets license for details.

Is it responsive?

Yes. It inherits the responsive grid and components from Bootstrap 5.2.0.

Bootstrap example and template. write your message contact form

About this bootstrap example/template

Optimized for copy‑paste: clean HTML, scoped CSS, and minimal JS so you can ship production‑ready UI faster and keep designs consistent.

Mobile‑first and responsive by default. Tested across modern browsers to reduce polish time on your project.

Already trusted in 430+ views. Reuse this snippet to speed up landing pages, dashboards, or onboarding flows.

Bootstrap 5.2.0

<link rel='stylesheet' href='https://cdn.jsdelivr.net/npm/[email protected]/dist/css/bootstrap.min.css'>

<script src='https://cdn.jsdelivr.net/npm/[email protected]/dist/js/bootstrap.bundle.min.js'></script>

This code example is based on bootstrap 5.2.0 and the grid system of this framework

Responsive

Based on bootstrap framework makes all the layouts perfectly responsive for all devices

Crossbrowser compatibility

Tested on all major browsers, it works smoothly on all of them

semantic html 5

Built on html / css3 the code quality is really amazing

Simple Integration

This code example can be simply integrated on existing sites and new ones too, all you need to do is copy the code and start working