Jump to content

Form won't line up next to text


Chrisj

Recommended Posts

I'm simply trying to put a search box (form) on the same line as the word "Search:", but it appears underneath the word Search: instead of to the right of it in IE7.

Any help will be appreciated. Thanks

 

<font size="6" color="#666666" face="Arial">Search:</font><form method="get" action="search.php"><input type="hidden" name="type" value="images" /><input type="text" name="keyword" size="32" value="Search" id="sbi" onclick="clickclear(this, 'Search')" onblur="clickrecall(this,'Search')" style="font-family: verdana; font-weight:; font-size: 10pt; height: 18px; width:240px; color:#000000; letter-spacing: 1; border: 2px inset #F5F5F5; background-color: #ffffff" /><input type="submit" value="Search" name="B2" style="font-family: verdana; font-weight:; font-size: 10pt; width:88px; color:#FFFFFF; letter-spacing: 1; border: 1px inset #F5F5F5; background-color: #990000" /></form>

 

Link to comment
Share on other sites

oh and for now this would work, i took the styles out but yano

 

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
	<title>Title</title>
	<meta http-equiv="Content-Type" content="text/html" />
	<link rel="stylesheet" type="text/css" href="s.css" />
</head>

<body>
	<form method="get" action="search.php">
		<table>
			<tr>
				<td>Search:</td>
				<td><input type="hidden" name="type" value="images" />
				<input type="text" name="keyword" size="32" value="Search" id="sbi" onclick="clickclear(this, 'Search')" onblur="clickrecall(this,'Search')" class="searchButton" style="background-color: #ffffff" /></td>
				<td><input type="submit" value="Search" name="B2" class="searchButton2" style="background-color: #990000" /></td>
			</tr>
	</form>
</body>
</html>

Link to comment
Share on other sites

Using a label for the input will line it up automagically :)

 

HTML:

 
<div class="searchbox">
<form method="get" action="search.php" style="float:left;">
    <input type="hidden" name="type" value="images" />
    <label for"keyword">Search:</label>
    <input type="text" name="keyword" size="32" value="Search" id="sbi" onclick="clickclear(this, 'Search')" onblur="clickrecall(this,'Search')"  />
    <input type="submit" value="Search" name="B2" class="sub-button" /></form>
</div>

 

CSS:

#sbi {
font:normal 12px verdana;
height: 18px;
width:240px;
color:#000000;
letter-spacing: 1;
border: 2px inset #F5F5F5;
background-color: #ffffff;
}

.sub-button{
font:normal 12px verdana;
width:88px;
color:#FFFFFF;
letter-spacing: 1;
border: 1px inset #F5F5F5;
background-color: #990000
}

.searchbox label {
font-size:30px;
color:#666;
}

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.