SitePoint Sponsor

User Tag List

Results 1 to 6 of 6
  1. #1
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    IL
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    left justify label over input box

    How do I left justify these labels over the input boxes? I can't figure this out:
    http://bobssaltandfeed.com/_/orderonline.php

    Thanks in advance for your input.

  2. #2
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,746
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Hi, ignoring the horribly invalid code (repeating an ID several times) you could simply set a width on the label
    Code:
    #AdminBody {width:260px;}
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  3. #3
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    IL
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Are you harshing my amateur coding? LOL! So I guess a class would be better? I created a class of .FormBody and changed the width to 260 like you suggested but it still looks centered. I'm sure there are other amatuer coding fopas so feel free to let me know what the right way to do things is, I'm totally trying to learn this. Thanks!

  4. #4
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,746
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Well it looked centered to me. That way was more of a quick fix anyway.

    Remove text-align:center on the parent, That will make everything go on the left.

    Give the parent some left padding and it will move everything over. That's the simplest way

    You have invalid markup by the way, I'd create a new parent (a <div>) and wrap the labels/inputs in that, and give that the left padding (the text-align:center is set as an inline style on the form)

    Work now, bye
    Always looking for web design/development work.
    http://www.CodeFundamentals.com

  5. #5
    SitePoint Addict
    Join Date
    Aug 2003
    Location
    IL
    Posts
    292
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Awesome, that works thank you!

  6. #6
    billycundiff{float:left;} silver trophybronze trophy RyanReese's Avatar
    Join Date
    Oct 2008
    Location
    Whiteford, Maryland, United States
    Posts
    13,746
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    You're welcome ! Glad it worked.
    Always looking for web design/development work.
    http://www.CodeFundamentals.com


Bookmarks

Posting Permissions

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