Go Back   CodingForums.com > :: Client side development > HTML & CSS

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 09-05-2008, 02:44 PM   PM User | #1
htcilt
Regular Coder

 
Join Date: Sep 2007
Posts: 238
Thanks: 9
Thanked 0 Times in 0 Posts
htcilt is an unknown quantity at this point
Vertically Centering Text and Images

I'm having trouble vertically centering both images and text together.
Here is the (untidied) code I'm using for testing purposes:

Code:
<div style="float:right;clear:right;font-weight:normal;height:26px;line-height:1.9">
<img src="images/esp_flag.gif" width="21" height="16" style="vertical-align:middle;margin-top:-3px" /> Español | <img src="images/chn_flag.gif" width="21" height="16" style="vertical-align:middle;margin-top:-3px" /> 中文简体</div></div>
And here's how they look in the 2 main browsers:



The vertical-align:middle works for firefox but not IE. Can anyone tell me what I need to add to get everything vertically centered properly?
Thank you.
htcilt is offline   Reply With Quote
Old 09-05-2008, 03:00 PM   PM User | #2
jerry62704
Senior Coder

 
jerry62704's Avatar
 
Join Date: Oct 2007
Location: Springfield, IL
Posts: 1,046
Thanks: 9
Thanked 81 Times in 81 Posts
jerry62704 is on a distinguished road
I would move the css to the head section of the page. Then I would add a IE hack to add a top padding. Once I got it working, I would then move the css to its own file.

The hack might look like this:

#yourdivid or img or .yourclass {
_padding-top: 3px; }

where you adjust the size to where you want it.
__________________
.
.
...and gladly would he learn and gladly teach

Visit www.LiberalsWin.com for humor and the unique Bush/Obama Approval Polls
jerry62704 is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:16 AM.


Advertisement
Log in to turn off these ads.