Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 06-26-2007, 02:16 PM   PM User | #1
goodespeler
New Coder

 
Join Date: Nov 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
goodespeler is an unknown quantity at this point
Styling a Form

I'm trying to turn this into xhtml/css:


Here are a few things to note...

The black background is an image with a slight gradiant. The magnifying glass should be the submit button.

Styling the actual input field seems to be pretty easy. Getting the search button/image to look right is where it get's hard.

Any advice?
goodespeler is offline   Reply With Quote
Old 06-26-2007, 02:58 PM   PM User | #2
whizard
Senior Coder

 
whizard's Avatar
 
Join Date: Jan 2005
Location: Philadelphia, PA, USA
Posts: 1,457
Thanks: 10
Thanked 37 Times in 37 Posts
whizard will become famous soon enoughwhizard will become famous soon enough
just do

<input type="image" name="submit" src="path_to_magnifying_glass_image" />

to use the image as a submit button, and place it next to the text field.

HTH
Dan
__________________
If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.
Step 1: Learn. Step 2: Search. Step 3: Post here.

Last edited by whizard; 06-26-2007 at 03:01 PM..
whizard is offline   Reply With Quote
Old 06-26-2007, 03:14 PM   PM User | #3
goodespeler
New Coder

 
Join Date: Nov 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
goodespeler is an unknown quantity at this point
Here's what I've got so far in terms of code:
http://joshuamcginnis.com/search.html

For the life of me, I can't get the button to line up.

Last edited by goodespeler; 06-26-2007 at 04:33 PM..
goodespeler is offline   Reply With Quote
Old 06-26-2007, 03:30 PM   PM User | #4
goodespeler
New Coder

 
Join Date: Nov 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
goodespeler is an unknown quantity at this point
Here, take a look at:
http://joshuamcginnis.com/search.html

The submit and input fields are right next to each other, but for some reason, the submit is always a few pixel's higher than the input field. It's much more noticeable in FireFox.

Last edited by goodespeler; 06-26-2007 at 03:34 PM..
goodespeler is offline   Reply With Quote
Old 06-26-2007, 03:30 PM   PM User | #5
whizard
Senior Coder

 
whizard's Avatar
 
Join Date: Jan 2005
Location: Philadelphia, PA, USA
Posts: 1,457
Thanks: 10
Thanked 37 Times in 37 Posts
whizard will become famous soon enoughwhizard will become famous soon enough
Your image is 40px high... so shouldn't your text field be the same height?

Dan

Edit:
This CSS works for me in FF2:

Code:
#keyword{
color: #fff;
vertical-align:bottom;
margin-bottom:5px;
margin-top: 40px;
width: 290px;
height: 27px;
padding: 3px 3px 3px 5px;
background: #fff url(labelbg.gif) repeat-x top left; 
border-bottom: 1px solid #fff;
border-right: 1px solid #fff;
border-top: 1px solid #ccc;
border-left: 1px solid #ccc;
}


#submit{
	background: url(submit.gif) no-repeat left top;
	height: 40px;
	width: 40px;
	margin-left: -10px;
vertical-align:bottom;
border: none;
	text-indent: -999%;
	line-height: 2px;
}
__________________
If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.
Step 1: Learn. Step 2: Search. Step 3: Post here.

Last edited by whizard; 06-26-2007 at 03:43 PM..
whizard is offline   Reply With Quote
Old 06-26-2007, 03:35 PM   PM User | #6
goodespeler
New Coder

 
Join Date: Nov 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
goodespeler is an unknown quantity at this point
No, the submit.gif image is 35 pixels high and 40 wide.
goodespeler is offline   Reply With Quote
Old 06-26-2007, 03:41 PM   PM User | #7
whizard
Senior Coder

 
whizard's Avatar
 
Join Date: Jan 2005
Location: Philadelphia, PA, USA
Posts: 1,457
Thanks: 10
Thanked 37 Times in 37 Posts
whizard will become famous soon enoughwhizard will become famous soon enough
Check out my edit
Dan
__________________
If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.
Step 1: Learn. Step 2: Search. Step 3: Post here.
whizard is offline   Reply With Quote
Old 06-26-2007, 03:44 PM   PM User | #8
goodespeler
New Coder

 
Join Date: Nov 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
goodespeler is an unknown quantity at this point
Yea, that was based off one of the methods I tried. I'm still seeing alignment issues in both FF and IE.
goodespeler is offline   Reply With Quote
Old 06-26-2007, 03:49 PM   PM User | #9
goodespeler
New Coder

 
Join Date: Nov 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
goodespeler is an unknown quantity at this point
Gettin' close. This is where I was last night. Not sure where to take it from here.
goodespeler is offline   Reply With Quote
Old 06-26-2007, 04:02 PM   PM User | #10
whizard
Senior Coder

 
whizard's Avatar
 
Join Date: Jan 2005
Location: Philadelphia, PA, USA
Posts: 1,457
Thanks: 10
Thanked 37 Times in 37 Posts
whizard will become famous soon enoughwhizard will become famous soon enough
at http://joshuamcginnis.com/search.html, I changed

#submit
{
vertical-align:bottom;
}

to:
vertical-align:baseline;

and it lined up.

I dont have a developer extension on IE, so I couldnt test it there

Dan
__________________
If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.
Step 1: Learn. Step 2: Search. Step 3: Post here.
whizard is offline   Reply With Quote
Old 06-26-2007, 04:06 PM   PM User | #11
goodespeler
New Coder

 
Join Date: Nov 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
goodespeler is an unknown quantity at this point
Worked great in FireFox, but made IE much worse...

Last edited by goodespeler; 06-26-2007 at 04:46 PM..
goodespeler is offline   Reply With Quote
Old 06-26-2007, 11:15 PM   PM User | #12
goodespeler
New Coder

 
Join Date: Nov 2003
Posts: 15
Thanks: 0
Thanked 0 Times in 0 Posts
goodespeler is an unknown quantity at this point
How does it render now in each browser?

Use this url: http://joshuamcginnis.com/
goodespeler is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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

Forum Jump


All times are GMT +1. The time now is 02:50 PM.


Advertisement
Log in to turn off these ads.