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
https://forums.phpfreaks.com/topic/182079-form-wont-line-up-next-to-text/
Share on other sites

well i would really need you to post the whole code to see if i cold modify it with some div's and then it might take a further ammount of time to remove the styling from each item and place it in a css file, ill post some code when i get home.

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>

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;
}

Archived

This topic is now archived and is closed to further replies.

×
×
  • 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.