background image
HomeRecent PostsDrupalSearchTagsRSSContactAboutAccount

Changing the user login block to a horizontal layout

Eric.London's picture

At some point your design may call for a horizontal user login block. Luckily this can be accomplished with just a few lines of CSS. I added the following CSS to my theme:

.block #user-login-form { text-align: left; }
.block #user-login-form #edit-name-wrapper { float: left; margin-right: 10px; }
.block #user-login-form #edit-pass-wrapper { float: left; margin-right: 10px; }
.block #user-login-form #edit-submit { float: left; margin-top: 25px; }
.block #user-login-form .item-list { clear: both; text-align: right; }

Before:

After:

This was quick and easy.

Thanks, I have also tried other ways but all of them bored me to death and I gave up. This was quick and easy. Thanks. Now if I could just figure out how to make the login button, and the Facebook connect buttons line up as well and tighten it all up. Then maybe I could squeeze it in my header or even the very top of the main page content. Right now its at the very bottom in the footer,which isn't ideal. Take a look if you want, I would love suggestions. http://www.xantaz.net/

Great solution.

I've seen so many other descriptions of how to do this, and even tried many of them. This is by far the simplest and most elegant. Thanks very much for sharing it!

Thanks

This was very helpful for moving the username, passwd; easy fix. Thanks

Wow!

I've seen others do this, but with more code and effort than your solution. It's very elegant. Thank you!

horizontal user login block

Thank you that worked for my drupal site. I changed only the "Register" & "Forgot Password" part.

You mentioned that you added

You mentioned that you added the CSS to your theme...which file did you add the above code to? Sorry but I'm a newbabe. thanks!

Eric.London's picture

style.css

This CSS is usually added to your theme's style.css file.

nice

very nice! but I'm new to drupal, so where in the style.css do you want me to add the code. thanks for your help

You may add the code to the

You may add the code to the end of the file.