Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 2 of 2
  1. #1
    New to the CF scene
    Join Date
    Dec 2010
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how to display a textbox below a label

    Hi all, am a newbie to css, so please be patient. All am trying to do is simply display a textbox below it's descriptive label. How can i get this done in css?
    Right now I have the html for my controls as below
    Code:
    <div class="label">
                    <asp:Label ID="lblNumber" runat="server" CssClass="lblStyle01">Number:</asp:Label>
                </div>
                <div class="value">
                    <asp:TextBox ID="TextBox8" runat="server" CssClass="txtStatic"></asp:TextBox>
                </div>
    and my current stlyes as

    Code:
    .lblStyle01
    {	font-size: 12px;
     	text-align:right;
    	}
    .txtStatic
    {	font-size: 12px;
     	background-color: #f4f4f4;
     	border: none;
    	}
    Thanks

  • #2
    New Coder
    Join Date
    Oct 2010
    Posts
    29
    Thanks
    0
    Thanked 2 Times in 2 Posts
    If I understand the question right, you want the first div to be over the second?

    Try:
    Code:
    .label, .value{
        position:static;
        float:none;
    }
    By default, div's always appear on there own line unless you float them or use a position: absolute, etc. So you must have some code somewhere that changes it. This would set it back to the default.

    Don't know if this is what your after, but I hope it helps.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •