Skip to content

Instantly share code, notes, and snippets.

@9paradox
Last active May 5, 2018 16:57
Show Gist options
  • Save 9paradox/5cbcd529a526acef3e54f0b41b6f9cd1 to your computer and use it in GitHub Desktop.
Save 9paradox/5cbcd529a526acef3e54f0b41b6f9cd1 to your computer and use it in GitHub Desktop.
Simple Horizontal Form using css. Align Label and Input Horizontally.
<html>
<head>
<style>
.text-center {
text-align: center;
}
.page {
margin: 10px auto;
width: 50%;
padding: 10px;
background-color: beige;
}
.group {
display: block;
clear: both;
}
.group label {
display: inline-flex;
}
.group .group-input {
width: 50%;
float: right;
}
</style>
</head>
<body>
<h1 class="text-center">horizontal Form</h1>
<div class="page">
<div class="group">
<lable>Name</lable>
<input type="text" class="group-input">
</div>
<div class="group">
<lable>Gender</lable>
<div class="group-input">
<label>M</label>
<input type="radio" name="gen">
<label>F</label>
<input type="radio" name="gen">
</div>
</div>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment