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

10-06-2007, 09:11 PM
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?

<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>

10-06-2007, 09:51 PM
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.

10-06-2007, 09:57 PM
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?

10-06-2007, 10:11 PM
<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.

10-06-2007, 10:45 PM
A better way is

<style type="text/css">
form {display : inline;}

and the best way is to put it in a separate stylesheet.