سؤال

I am new to div tags since I was using tables previously. I would like to display label and text box eg: First Name :________ for that I have written like this

<div>
<div>firstName</div><div style="float:left;"><asp:textbox id="test" runat="server"/></div></div>.

I guess creates one section, right ? I don't get how float attribute takes textbox control to the first line instead of second line. pls clarify !

هل كانت مفيدة؟

المحلول

you can assign both label and the input field an ID and set then both to float:left.

like:

<label id="testLabel" for="input1">Name:</label>

or if you have them placed in separate divs, then assign those divs an ID and float them.

مرخصة بموجب: CC-BY-SA مع الإسناد
لا تنتمي إلى StackOverflow
scroll top