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 11-29-2009, 02:16 PM   PM User | #1
skcin7
Regular Coder

 
Join Date: Jul 2009
Posts: 186
Thanks: 72
Thanked 2 Times in 2 Posts
skcin7 is an unknown quantity at this point
Forms in IE - Why is the Search button above everything else?

I am designing a form on my website and I can't seem to figure out why the Search button is aligned above everything else. I want the search button to be aligned evenly with the text box and the drop-down box but for some reason it is aligned above everything else. Here is a picture of what I am talking about:


Here is the code for it: (it's just a simple form)
Code:
<form method="get" action="search.php">
  <input type="text" name="term" style="font-size: 10px;">
  <select name="site" style="font-size:10px;">
    <option value="">VGDB</option>
    <option value="ebay">eBay</option>
    <option value="amazon">Amazon</option>
  </select>
  <button style="font-size:10px;">Search</button>
</form>
I tried to fix the problem myself but each time I made a change it made the buttom look bad in Firefox. Does anybody know good solutions to this problem? Thanks in advance for any help!

Last edited by skcin7; 11-29-2009 at 02:19 PM..
skcin7 is offline   Reply With Quote
Old 11-29-2009, 04:45 PM   PM User | #2
Excavator
Master Coder


 
Excavator's Avatar
 
Join Date: Dec 2006
Location: Alaska
Posts: 9,410
Thanks: 22
Thanked 1,765 Times in 1,749 Posts
Excavator has a spectacular aura aboutExcavator has a spectacular aura aboutExcavator has a spectacular aura about
Hello skcin7,
I think your looking at a browsers default margin. Try using a CSS reset like this bit highlighted in red -
Code:
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
<style type="text/css">
html, body {
	font: 100.1% "Comic Sans MS";
	background: #FC6;
}
* {
	margin: 0;
	padding: 0;
	border: 0;
	outline: 0;
}
#container {
	height: 400px;
	width: 800px;
	margin: 30px auto;
	background: #999;
	font-size: 0.8em;
}
</style>
</head>
<body>
    <div id="container">
        <form method="get" action="search.php">
            <input type="text" name="term" style="font-size: 10px;">
                <select name="site" style="font-size:10px;">
                    <option value="">VGDB</option>
                    <option value="ebay">eBay</option>
                    <option value="amazon">Amazon</option>
                </select>
            <button style="font-size:10px;">Search</button>
        </form>
    <!--end container--></div>
</body>
</html>
Once you reset the defaults that can differ from browser to browser, you can specify your own. Have a look at this page about resets.
__________________
Validate often DURING development - Use it like a splelchecker | Debug during Development |Write it for FireFox, ignore IE
Use the right DocType | Validate your markup | Validate your CSS | Why validating is good | Why tables are bad
Excavator is offline   Reply With Quote
Users who have thanked Excavator for this post:
skcin7 (11-29-2009)
Old 11-29-2009, 06:03 PM   PM User | #3
skcin7
Regular Coder

 
Join Date: Jul 2009
Posts: 186
Thanks: 72
Thanked 2 Times in 2 Posts
skcin7 is an unknown quantity at this point
HA! I got it by doing something similar to what you did - i just messed around with the margin and border attributes. Thanks, I wouldn't have thought of that if not for your post!
skcin7 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 09:10 AM.


Advertisement
Log in to turn off these ads.