@@ -13,7 +13,7 @@ <h1 class="text-xl font-bold mb-4 text-gray-800">Float Labels Example</h1>
1313
1414 < form class ="space-y-4 ">
1515 < div class ="float-container ">
16- < label for ="name " class ="float-label text-gray-600 "
16+ < label for ="name " class ="float-label px-2 text-gray-600 "
1717 > Full Name (1: empty)</ label
1818 >
1919 < input
@@ -25,7 +25,7 @@ <h1 class="text-xl font-bold mb-4 text-gray-800">Float Labels Example</h1>
2525 </ div >
2626
2727 < div class ="float-container float-always ">
28- < label for ="sticky " class ="float-label text-gray-600 "
28+ < label for ="sticky " class ="float-label px-2 text-gray-600 "
2929 > Sticky (sticky)</ label
3030 >
3131 < input
@@ -37,7 +37,7 @@ <h1 class="text-xl font-bold mb-4 text-gray-800">Float Labels Example</h1>
3737 </ div >
3838
3939 < div class ="float-container ">
40- < label for ="email " class ="float-label text-gray-600 "
40+ < label for ="email " class ="float-label px-2 text-gray-600 "
4141 > Email Address (2: is focused)</ label
4242 >
4343 < input
@@ -50,7 +50,7 @@ <h1 class="text-xl font-bold mb-4 text-gray-800">Float Labels Example</h1>
5050 </ div >
5151
5252 < div class ="float-container ">
53- < label class ="float-label text-gray-600 "
53+ < label class ="float-label px-2 text-gray-600 "
5454 > What type of event is it?</ label
5555 >
5656 < select class ="float-input w-full px-3 py-2 border border-gray-300 ">
@@ -63,7 +63,9 @@ <h1 class="text-xl font-bold mb-4 text-gray-800">Float Labels Example</h1>
6363 </ div >
6464
6565 < div class ="float-container ">
66- < label class ="float-label text-gray-600 "> Additional details</ label >
66+ < label class ="float-label px-2 text-gray-600 "
67+ > Additional details</ label
68+ >
6769 < textarea
6870 class ="float-input w-full border border-gray-300 p-2 "
6971 rows ="3 "
@@ -86,13 +88,6 @@ <h1 class="text-xl font-bold mb-4 text-gray-800">Float Labels Example</h1>
8688 window . onload = ( ) => {
8789 const focusedElement = document . querySelector ( '#name' ) ;
8890
89- // email.addEventListener('blur', function (e) {
90- // // Re-focus immediately after blur
91- // setTimeout(() => {
92- // email.focus();
93- // }, 2000);
94- // });
95-
9691 focusedElement . focus ( ) ;
9792 } ;
9893</ script >
0 commit comments