Wrap all the text in a div so you can add a top pad so they all line up on the same line well. Always indicate the width when swimming. It’s easier for me to specify the float as everything on the left and have a specific width.
Markup
<div class="panel">
<div class="displayModes">
Search for products:
</div>
<div class="searchPanel">
<div style="float:left;width:60px;padding-top:2px;">
Search :
</div>
<div style="float:left;width:100px;">
<input name="txtSearch" type="text" id="txtSearch" style="height:14px;" />
</div>
</div>
</div>
CSS
.displayModes
{
float:left;
width:200px;
padding-top:2px;
padding-left: 2px;
text-align: center;
}
.searchPanel
{
float: left;
width:200px;
margin-right: 150px;
text-align: center;
}
.panel
{
font-family: Arial, Verdana, Sans-serif;
font-size: 12px;
padding-top:10px;
width:600px;
}
Update without additional sections for centering labels
Markup
<div class="panel">
<div class="displayModes">
Search for products:
</div>
<div class="searchPanel">
Search :
<input name="txtSearch" type="text" id="txtSearch" style="height:14px;"/>
</div>
</div>
CSS
.displayModes
{
float:left;
width:200px;
padding-top:4px;
padding-left: 2px;
text-align: center;
}
.searchPanel
{
float: left;
width:200px;
margin-right: 150px;
text-align: center;
}
.panel
{
font-family: Arial, Verdana, Sans-serif;
font-size: 12px;
padding-top:10px;
width:600px;
}
source
share