I have to do text and input in one line. Without table tag, even after trying all the methods, it did not work for me. what to | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
0

I have to do text and input in one line. Without table tag, even after trying all the methods, it did not work for me. what to

https://code.sololearn.com/WK0Kdg5PNtMJ/?ref=app

28th May 2023, 1:37 AM
Tausif Ansari
Tausif Ansari - avatar
6 Answers
+ 1
Tausif Ansari The problem is that you put a label and an input into separate divs. Just put every such pair into one div one after another, and they will be on one line.
1st Jun 2023, 9:30 AM
Евгений
Евгений - avatar
+ 1
28th May 2023, 9:05 AM
Bob_Li
Bob_Li - avatar
+ 1
even without css, a label tag is inline with the input element, unless you mess it up with divs and br... <body> <label for="name">name:</label> <input id="name"/> <br><br> <fieldset> <legend>Amount:</legend> <label for="q1">1</label> <input id="q1" type="radio" name="qty" value="1" checked> <label for="q2">2</label> <input id="q2" type="radio" name="qty" value="2"> <label for="q3">3</label> <input id="q3" type="radio" name="qty" value="3"> </fieldset> <br> <fieldset> <legend>Options:</legend> <label for="op1">red</label> <input id="op1" type="checkbox" name="col" value="red" checked> <label for="op2">blue</label> <input id="op2" type="checkbox" name="col" value="blue"> <label for="op3">green</label> <input id="op3" type="checkbox" name="col" value="green"> </fieldset> <br> <label for="models">Models:</label> <select id="models"> <option value="A1">A1</option> <option value="A2">A2</option> <option value="A3">A3</option> </select>
28th May 2023, 10:28 AM
Bob_Li
Bob_Li - avatar
+ 1
To get most of feedback make your example as short as possible, yet showing the problem you are addressing to.
30th May 2023, 11:41 AM
Евгений
Евгений - avatar
0
Bob_Li You are a great coder but this is not the solution to my problem. But again your code was so good. Thank you so much for this 🙂
1st Jun 2023, 2:16 AM
Tausif Ansari
Tausif Ansari - avatar
0
Ebrehnn... Wow your suggestion is too good. Thanks for this 👍
11th Jun 2023, 3:33 AM
Tausif Ansari
Tausif Ansari - avatar