3 replies [Last post]
a_l_a_n
Offline
newbie
Last seen: 12 years 46 weeks ago
Timezone: GMT+1
Joined: 2007-06-09
Posts: 4
Points: 0

How can I have a form displayed inline with other text? As it is the form always appears below, as though it were in a paragraph.

Heres my code (sans the php that makes it useful). It uses javascript to make a link ("[Logout]") submit an otherwise empty form which causes the user to be logged out.

Welcome Username

function logout_link()
{
document.logout.submit();
}

" method="POST"
[Logout]

It will display like this:

Welcome Username
[Logout]

I want:

Welcome Username [Logout]

Thanks.

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 39 weeks 5 hours ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

Give the CSS rule "display:

Give the CSS rule "display: inline;" to your form, or float it.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.

a_l_a_n
Offline
newbie
Last seen: 12 years 46 weeks ago
Timezone: GMT+1
Joined: 2007-06-09
Posts: 4
Points: 0

Thats a kicker. Im sure I

Thats a kicker. Im sure I tried inlining the form ... must have gotten the selector wrong or something because it didnt work before. Does now though.

Thanks.

Ed Seedhouse
Ed Seedhouse's picture
Offline
Guru
Victoria British Columbia
Last seen: 39 weeks 5 hours ago
Victoria British Columbia
Timezone: GMT-8
Joined: 2005-12-14
Posts: 3570
Points: 675

Well, if any of the inner

Well, if you'd used child elements to the form that were themselves block elements, like, say, fieldset, then you'd have had to use "display: inline;" on them as well. So my advice was a little oversimplified, I think. On the other hand it worked in this case.

Ed Seedhouse

Posting Guidelines

Watch out! I am carrying irony, sarcasm and satire, and know how to use them.