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
    Jul 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Aligning HTML elements horizontaly

    how to align these elements next to each others and not below each others?

    <form action="http://xx.xxx.com/checker.php" method="post">
    <input type="hidden" name="tokenz" value="9oaisdkjasiduqasdkjiwue" />
    <input type="hidden" name="directz" value="true" />
    Domain: <input type="text" name="domain" size="20" /> <select name="ext">
    <option>.com</option>
    <option>.org</option>
    <option>.net</option>
    <option>.biz</option>
    <option>.info</option>
    <option>.us</option>
    <option>.pw</option>
    <option>.in</option>
    <option>.name</option>
    <option>.mobi</option>
    <option>.asia</option>
    </select>
    <input type="submit" value="Go" />
    </form>

  • #2
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    Code:
    <form action="http://xx.xxx.com/checker.php" method="post">
    <input class="horiz" type="hidden" name="tokenz" value="9oaisdkjasiduqasdkjiwue" />
    <input class="horiz" type="hidden" name="directz" value="true" />
    Domain: <input class="horiz" type="text" name="domain" size="20" /> <select class="horiz" name="ext">
    <option>.com</option>
    <option>.org</option>
    <option>.net</option>
    <option>.biz</option>
    <option>.info</option>
    <option>.us</option>
    <option>.pw</option>
    <option>.in</option>
    <option>.name</option>
    <option>.mobi</option>
    <option>.asia</option>
    </select>
    <input class="horiz" type="submit" value="Go" />
    </form>
    CSS code:

    .horiz
    {
    display:inline;
    }


    Edit:
    Or, if you aren't ever having a vertical form, you can just write


    input
    {
    display:inline;
    }



    HTH
    Dan
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

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