Last active
May 5, 2018 16:57
-
-
Save 9paradox/5cbcd529a526acef3e54f0b41b6f9cd1 to your computer and use it in GitHub Desktop.
Simple Horizontal Form using css. Align Label and Input Horizontally.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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