문제

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