PDA

View Full Version : Show/Hide Help


DigitalBliss
04-10-2005, 05:37 AM
Hey I have a show/hide script here that when I click a link it shows a login form. I made a picture to better explain what I want.

http://starlitdesigns.com/demo.gif

What I want is the login form to be on the right side of the word login instead of under it. Here is my code:


echo"<a href=\"register.php\">Register</a> || <a href=\"javascript:void(0);\" onClick=\"showHide('loginform')\";>Login</a>

<div class=\"hidden\" id=\"loginform\">

<form action=\"account.php?function=login&url=$url\" method=\"post\">

<input class=\"textfield\" type=\"text\" name=\"username\" maxlength=\"25\" size=\"15\">

<input class=\"password\" type=\"password\" name=\"password\" maxlength=\"25\" size=\"15\" value=\"Password\">

<input class=\"submit\" type=\"submit\" value=\"Login\">

</form></div>";

// I spaced it out so everyone can see fine, in actuality the code is bunched up


Someone please help :( :(

chilipie
04-10-2005, 10:21 AM
Add some more CSS to div#loginform:div#loginform {
display: inline;
}You might need to fiddle around with the padding/margin after, but that should do the trick ;) .

Just to explain why it happened: the <div> tag is a block-level element (ie. the default 'display' setting is 'block'). Block-level elements need a line to themselves, unless you style them not to. Hope that clears up any confusion :) .