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 5 of 5
  1. #1
    New Coder
    Join Date
    Oct 2007
    Posts
    23
    Thanks
    3
    Thanked 0 Times in 0 Posts

    display:inline useage (need what follows <form> on same line)

    Ok, so I can't seem to use display:inline correctly. I want a pic, then a <form> followed by a text box and submit button + links on the same line.

    I want all the following to be on the same line, and perhaps even centered correctly. I'm having trouble accomplishing this without tables. How would I go about doing this?

    Code:
    <img src="picture.jpg">
    
    <form id="search" action="search.html" method="get">
    
    <input type="text" name="q" size="30" maxlength="150" value="'.($q).'" title="Search"><font size=-1><input type="submit" name="Submit" value="Search"></form></font>
    
     &nbsp;&nbsp;<a href=/link.html>Link</a><br>&nbsp;&nbsp;<a href=/link2.html>Link2</a>

  • #2
    New to the CF scene
    Join Date
    Oct 2007
    Posts
    5
    Thanks
    1
    Thanked 0 Times in 0 Posts
    I'm essentially trying to do the same thing! The use of a <form> always makes it so what's after it goes to the next line. All I want is to have a graphic, text bar, submit button, and links on the same line but after asking loads of different people (and I mean loads) no one has had any ideas as to what to really do. It seems like it should be very simple but in fact this is one of the most complex issues around and all it is is aligning things on the same line. We might have to actually pay someone to in order to get a graphic, text bar and button on the same line which is insane, but oh well. People who know how to do this are either a) Not willing to help or b)"Need" money for an answer. This is total insanity.

  • #3
    New Coder
    Join Date
    Oct 2007
    Posts
    23
    Thanks
    3
    Thanked 0 Times in 0 Posts
    Why is this so hard to do then? I started learning how to make web sites very recently and I thought something like this was easy to do? This is very aggrovating to hear. A couple people told me to just use absolute positioning but then another few people told me there is no way I should do that. Perhaps I'm looking for help in the wrong place I just can't believe I can't find a single coded example of a picture, a <form> followed by some other stuff aligned on the same line! Perhaps I need to have years of experience to do this?

  • #4
    Regular Coder ghostz00's Avatar
    Join Date
    Aug 2006
    Posts
    128
    Thanks
    11
    Thanked 2 Times in 2 Posts
    Code:
    <img style="display:inline" src="picture.jpg">
    
    <form style="display:inline" id="search" action="search.html" method="get">
    
    <input style="display:inline" type="text" name="q" size="30" maxlength="150" value="test" title="Search"><input type="submit" name="Submit" value="Search"></form></font>
    
    <a href=/link.html>Link</a><a href=/link2.html>Link2</a>
    This is probably not the best way to do it, but it works.

    btw you should probably use css to change your font sizes.
    Greg

  • #5
    Master Coder felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, Australia
    Posts
    6,640
    Thanks
    0
    Thanked 649 Times in 639 Posts
    A better way is

    Code:
    <style type="text/css">
    form {display : inline;}
    </style>
    and the best way is to put it in a separate stylesheet.
    Stephen
    Learn Modern JavaScript - http://javascriptexample.net/
    Helping others to solve their computer problem at http://www.felgall.com/

    Don't forget to start your JavaScript code with "use strict"; which makes it easier to find errors in your code.


  •  

    Posting Permissions

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