I work on template using html and CSS . I face issue I can't do alignment label text on left and right to be same .
as example
submit Date and Employee id not start from same point on left so I need all text on left have same alignment .
also on right also text not start from same point as ??? ?????? and ??? ??????
so I need all text on right have same alignment .
full html and CSS what I try as below :
CSS
.label-container {
display: flex;
justify-content: space-between;
}
.left-label {
text-align: left;
}
.right-label {
text-align: right;
}
.form-header {
color: black;
background-color: gray;
text-align: center;
width: 50%;
padding: 20px;
margin: 10px auto;
}
.form-header h2 {
margin: 0;
font-weight: 500;
}
.form-container {
border: 2px dashed gray;
border-bottom: none;
max-width: 100%;
padding-bottom: 10px;
margin: 0 auto;
}
.form-info {
font-size: 18px;
display: flex;
justify-content: space-between;
align-items: center;
padding: 0px 5px;
background-color: gray;
}
.employee-info {
display: flex;
justify-content: space-around;
}
.id_container {
display: flex;
gap: 10px;
margin-left: 10px;
}
.name_container {
display: flex;
gap: 10px;
}
.table-border-end {
height: 50px;
border-top: 2px dashed gray;
border-bottom: 2px dashed gray;
}
label {
display: block;
font-weight: bold;
margin-bottom: 5px;
}
input[type="text"] {
width: 100%;
padding: 5px;
border: 1px solid #ccc;
border-radius: 3px;
}
h1 {
text-align: center;
}
form {
margin-top: 20px;
}
label {
display: block;
margin-top: 10px;
font-weight: bold;
}
input[type="text"],
textarea,
input[type="date"] {
width: 100%;
padding: 5px;
}
input[type="submit"] {
background-color: #4caf50;
color: white;
padding: 10px 20px;
border: none;
border-radius: 4px;
cursor: pointer;
margin-top: 20px;
}
input[type="submit"]:hover {
background-color: #45a049;
}
.line-container {
margin-top: 30px;
}
.line {
border: none;
border-top: 1px solid black;
margin: 0;
}
.solid-table {
border-collapse: collapse;
width: 100%;
}
.solid-table th,
.solid-table td {
border: 1px solid black;
padding: 8px;
text-align: center;
}
????? ????? ???????
Resignation Submission Form
To be filled by the Employee
??? ????? ?? ??????
Emp. ID:
-------------------
:??? ??????
Emp Name:
-----------------------------------
:??? ??????
Dept./Branch:
-------------------
:?????/??????
Designation:
-----------------------------------
:?????? ???????
Submittion Date:
-------------------
:????? ????? ?????????
Mobile No:
-----------------------------------
:??? ??????
Last Working Date:
-------------------
:??? ??? ???
Employee Signature:
-----------------------------------
:????? ??????
Reason:
-------------------
-------------------
:??? ?????????
-------------------------------------------------------
-------------------------------------------------------------
Important Note :
:?????? ????
Employee should work 14 days, 30 Days or 90 Days’ Notice
period as per Labor contract from the date of submission of
resignation. If the employee fails to do so, salary for
unserved Notice period will be deducted from the final
settlement (as per Labor Law). Employees are not eligible
for any leave during the Notice period.
*Ensure to complete checklist for Separation with Branch/
Dept./Div. Dir. on your last Day.
??? ??? ?????? ????? ????? ????? ???? ????? ????? 14 ??? ?? 30 ???? ?? 90 ???? ??? ??? ????? ?? ????? ????? ????????? ?? ???? ??? ???????? ????? ??????? ??????? ??? ????? ?? ??????? ????? ?????? ??? ????? ????? ????? ?????? ?????? ??? ?? ????? ???? ???? ??????? ???? ?????? ?? ????? ??????? ?????? ?????? ?????? ?? ?????/???? ???????/ ?????? ?? ??? ??? ??? ??
Line Manager Remarks:
:??????? ?????? ???????
Signature
:???????
Date :
----/-----/----
: ???????
Dept./ Div. Dir. or Dept. Mgr. Remarks :
:??????? ???? ???????/???? ??????
Signature
:???????
Date :
----/-----/----
: ???????
HR & Emiratisation Director Remarks :
:??????? ???? ????? ??????? ??????? ????????
Signature
:???????
Date :
----/-----/----
: ???????
CEO Remarks(if applicable) :
:??????? ?????? ???????? ??? ???
Signature
:???????
Date :
----/-----/----
: ???????expected result as below :


Prasad RaveendranRank #320 · 7.8K reputationPosted Sep 25, 2023, 2:41 PM EDT
It looks like you want to align the text on the left and right sides of your form so that they start from the same point. To achieve this, you can use CSS to adjust the widths of your labels and ensure consistent padding. Here's an updated version of your HTML and CSS with the necessary changes:
/* ... Your existing CSS ... */ .employee-info { display: flex; justify-content: space-between; margin-bottom: 10px; /* Add margin to separate each employee info section */ } .id_container, .name_container { flex: 1; /* Make both sides (left and right) equal width */ display: flex; justify-content: space-between; align-items: center; } .id_container label, .name_container label { width: 45%; /* Adjust the width as needed */ text-align: left; /* Ensure text on both sides is left-aligned */ margin: 0; /* Reset margin for labels */ }In this updated code, I've made the following changes:
Added
margin-bottomto the.employee-infoclass to separate each employee info section vertically.Modified the
.id_containerand.name_containerclasses to haveflex: 1, ensuring both sides are equal width within each employee info section.Adjusted the
width,text-align, andmarginproperties for the labels within these containers to ensure left alignment and consistent width.These changes should help align the text on both the left and right sides of your form. You can adjust the
widthvalues as needed to achieve the desired alignment.