Way cool, super deluxe, nifty input boxes

This is a discussion on "Way cool, super deluxe, nifty input boxes" within the Web Page Design section. This forum, and the thread "Way cool, super deluxe, nifty input boxes are both part of the Design Your Website category.



Go Back   Webforumz.com > Main Forums > Design Your Website > Web Page Design

Notices


Reply
 
LinkBack Thread Tools
  #1 (permalink)  
Old Jul 31st, 2007, 18:33
Junior Member
Join Date: Jul 2007
Location: Dallas, TX
Posts: 20
Thanks: 0
Thanked 0 Times in 0 Posts
Smile Way cool, super deluxe, nifty input boxes

Recently I was challenged to implement some Username/Password input boxes on a client's site.

Alas, these were no ordinary, run-of-the-mill input boxes nor were they moderately styled with a perhaps a colored background and/or border.

Nay! Nay! These input boxes had rounded corners, a drop shadow and a background pattern as well.

Example:


At first I was vexed, but I refused to be defeated by an input box!
After much gnashing of teeth and wringing of hands the answer came to me...

FIrst I removed all borders from my input boxes:

Code: Select all
input{
border:0;
}
Then I created a style called usernamePassword which will style both the Username and Password input boxes.

I decided to use the drop shadowed, patterend image (input_username.gif) as a background within the input boxes.

The comp showed that the input boxes were to be 95px wide and 19px tall, so armed with that information I made the input boxes 95px by 19px, reduced the font size by 25% and specified the input text would be grey.

.usernamePassword
{
font-size:75%;
color:#666666;
height:19px;
width:95px;
background-image:url('/images/input_username.gif');
background-repeat:no-repeat;
}

This however, made the text bump into the edge of the input box, destroying the illusion of a rounded corner and drop shadow.

By adding a little padding, the text can be positioned within the input box and place it inside the curve and below the drop shadow.

.usernamePassword
{
font-size:75%;
color:#666666;
height:19px;
width:95px;
background-image:url('../images/input_username.gif');
background-repeat:no-repeat;
padding:3px 6px 0 6px;
}

One would think that we were now finished...but not so. Of course...IE6 must cause a problem. Simply specifying the background not to repeat isn't enough. When a username of password is exceptionally long, the background scrolls with the text.

So...we need (yet another) fix for IE.

.usernamePassword
{
font-size:75%;
color:#666666;
height:19px;
width:95px;
background-image:url('../images/input_username.gif');
background-repeat:no-repeat;
padding:3px 6px 0 6px;
/*for IE*/
background-attachment: fixed;
}

Now all we have to do is align the image we are using as our input button, like so;
Code: Select all
.logInButton
{
 vertical-align:-4px;
}
/* for IE6*/
*html .logInButton
{
 vertical-align:2px;
}
Here's the code for the form itself:
Code: Select all
<form name="foo" action="foo" method="post">
     <input type="text" name="username" value="Login Name" class="usernamePassword" />
     <input type="password" name="password" value="Password" class="usernamePassword" />
     <input type="image" src="http://www.webforumz.com/images/btn_login.jpg" name="login" class="logInButton" />
   </form>
Here's the final CSS:

Code: Select all
.usernamePassword
{
font-size:75%;
color:#666666;
height:19px;
width:95px;
background-image:url('../images/input_username.gif');
background-repeat:no-repeat;
padding:3px 6px 0 6px;
/*for IE*/
background-attachment: fixed;
}
Voila! Easy cheesy!

Last edited by Skelbo; Aug 1st, 2007 at 02:36.
Reply With Quote

  #2 (permalink)  
Old Jul 31st, 2007, 18:50
SuperMember

SuperMember
Join Date: Sep 2006
Location: Pink House
Posts: 3,946
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Way cool, super deluxe, nifty input boxes

Wow that is soooooooooo nice!!!
Reply With Quote
  #3 (permalink)  
Old Jul 31st, 2007, 18:53
VanessaJW's Avatar
SuperMember

SuperMember
Join Date: Apr 2007
Location: Kent, England
Age: 37
Posts: 560
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Way cool, super deluxe, nifty input boxes

Cool You can be on my team...
Reply With Quote
  #4 (permalink)  
Old Aug 1st, 2007, 20:56
Junior Member
Join Date: Jul 2007
Location: zimwabee
Posts: 32
Thanks: 0
Thanked 0 Times in 0 Posts
Re: Way cool, super deluxe, nifty input boxes

I love it. The title describes it perfectly
Reply With Quote
Reply

Tags
inputs, input box, forms, css

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads
Thread Thread Starter Forum Replies Last Post
Input Boxes Aaron1988 Web Page Design 30 Feb 1st, 2007 10:57
drop-down menus / input boxes etc ktsirig Web Page Design 3 Oct 7th, 2005 09:15
Super Cool Free Stuff Webforumz Staff ASP.NET Forum 11 Jul 27th, 2004 20:30


All times are GMT. The time now is 07:11.


Powered by vBulletin®
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0 RC8
© 2003-2008 Webforumz.com : All Rights Reserved

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43