Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Westi on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Align SELECT ListBox with text properly

Status
Not open for further replies.

TheDust

Programmer
Aug 12, 2002
217
US
I have a multiple-selection listbox with some text directly right of it. No matter what CSS or HTML tags I try to use, I can't get the text to line up with the top of the listbox. All text that follows simply aligns with the bottom of the listbox. Does anyone have an idea for why this is? I'm viewing this in Mozilla, BTW... any help or advice is MUCH appreciated. Thanks!
 
Can you should your code so we can give you an answer specific to your needs?

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
The following works for me:
Code:
<form>
  <p>
    <select size="3" [b][COLOR=blue]style="vertical-align: top;"[/color][/b]>
      <option>0</option>
      <option>1</option>
      <option>2</option>
      <option>3</option>
      <option>4</option>
    </select>
    Blah blah blah
  </p>
</form>
 
Thanks, Vragabond! That did it. I can't believe it was that easy. I thought I had tried using the vertical-align property already, but with baseline, bottom, etc. tried out. Didn't even try what should've been the next easiest guess. Thanks very much!
 
Unfortunately vertical-align isn't widely supported. You may want to play around with padding and margins.

*cLFlaVA
----------------------------
Lois: "Peter, you're drunk!"
Peter: "I'm not drunk, I'm just exhausted from stayin' up all night drinking!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top