JSFiddle - React, Tailwind, and code Playground

by Sampath_Madhuranga

HTML

<script src="//code.jquery.com/jquery-3.3.1.slim.min.js"></script>
<link rel="stylesheet" href="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/css/bootstrap.min.css">
<script src="//cdnjs.cloudflare.com/ajax/libs/popper.js/1.14.0/umd/popper.min.js"></script>
<script src="//stackpath.bootstrapcdn.com/bootstrap/4.1.0/js/bootstrap.min.js"></script>
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
<div class="container">
 <form class="sample-form">
   <div class="form-group">
    <label for="usr">Name:</label>
    <input type="text" class="form-control" id="usr">
  </div>
 </form>
</div>

CSS

.sample-form {
  margin: 15px 0;
}

.sample-form .form-group {
  position: relative;
}

.sample-form .form-group label {
  position: absolute;
  top: -15px;
  left: 15px;
  background-color: #ffffff;
  margin: 0;
  padding: 2px 5px;
}