How to get the label ,textbox,dropdown ,radio button in the same line in the asp.net using css
How to get the label ,textbox,dropdown ,radio button in the same line
2 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Manav Mathur5 reputationPosted May 2, 2023, 9:17 AM EDT
Try this:
HTML:
CSS:
.form-group label,
.form-group input,
.form-group select,
.form-group .radio {
display: inline-block;
margin-right: 10px;
}
This code will align the label, textbox, dropdown, and radio button in the same line. The
display: inline-block;property makes each element behave like an inline element while retaining their block-level properties. Themargin-right: 10px;property provides a 10px margin to the right of each element to create some space between them.Hope this helps!
Amit MohantyRank #112 · 20K reputationPosted May 3, 2023, 12:11 AM EDT
Try this:
CSS:
.form-container { display: grid; grid-template-columns: 1fr 1fr; grid-gap: 10px; } .form-container label { grid-column: 1 / 2; } .form-container input, .form-container select, .form-container .radio-group { grid-column: 2 / 3; }