vertical align issue

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
alex.barylski
DevNet Evangelist
Posts: 6267
Joined: Tue Dec 21, 2004 5:00 pm
Location: Winnipeg

vertical align issue

Post by alex.barylski »

Code: Select all

<img src="assets/images/icons/dashboards/chart.png" width="16px" height="16px" alt="" /><strong>Detailed Statistics</strong>&nbsp;<select style="padding-top: 2px">    <option>March</option>    <option>April</option></select>
I cannot figure out how to each element to vertically align so it looks nice in IE... :banghead:

I have tried wrapping it in a DIV and setting vertical-align: middle, baseline, etc...

I have also tried setting the padding-top, top, etc of each element individually but the damn <strong> tag doesn't budge...

Ideas?
User avatar
Christopher
Site Administrator
Posts: 13596
Joined: Wed Aug 25, 2004 7:54 pm
Location: New York, NY, US

Re: vertical align issue

Post by Christopher »

Try reset.css
(#10850)
matthijs
DevNet Master
Posts: 3360
Joined: Thu Oct 06, 2005 3:57 pm

Re: vertical align issue

Post by matthijs »

As arborint suggested first reset everything.

Then play a bit with margins (also negative margins to pull stuff up/down).
User avatar
pickle
Briney Mod
Posts: 6445
Joined: Mon Jan 19, 2004 6:11 pm
Location: 53.01N x 112.48W
Contact:

Re: vertical align issue

Post by pickle »

Vertical-align is, as far as I'm concerned, the bastard child of CSS. It's not very straightforward how to use. Vertical-align generally applies to an element itself, & is not necessarily inherited by it's children. Wrap what you've got in a div & give it a class or id. Then use this CSS:

Code: Select all

#yourDiv *{
vertical-align:middle;
}
Of course, change #yourDiv to whatever is necessary. That should vertically align everything.
Real programmers don't comment their code. If it was hard to write, it should be hard to understand.
Post Reply