Reply
Vertically aligning text in a div in our favorite browser?
Old 05-14-2008, 09:51 PM Vertically aligning text in a div in our favorite browser?
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
Alright I looked at the links at the top, but they confused me. I have it working in Opera, Safari, and Firefox betas, I'm running IE8 Beta on my one computer and IE7 on the other. IE8 hasn't fixed this 'unexpected feature' yet. Before I show what I currently have, I'm working on this for someone else who is using tables, I'm attempting to switch over to CSS for them, but just got to the point where I can start that, first I had to remove a lot of stuff such as the closing align tags (nope not even an opening align tag). So this is what I currently have:
HTML Code:
<tr><td><div style="height:32px;width:176px;background-image:url(images/button.png);min-height:32px;display:table-cell;vertical-align:middle;text-align:center;"><span style="font-size:0.85em;"><a href="index.html" class="left">Home</a></span></div></td></tr>
The CSS I have is:
Code:
body {background-color:#FFFFFF;color:#000000;}
a:link {background-color:#FFFFFF;color:#8B0000;}
a:visited {background-color:#FFFFFF;color:#808080;}
a.left:link {background-color:#808080;font-family:Brush Script MT;}
a.left:visited {background-color:#808080;font-family:Brush Script MT;color:#8B0000;}
a.left:hover {background-color:#808080;font-family:Brush Script MT;color:#FFFF70;}
If you want to cry the site I'm working on is http://www.earthquakeresurrection.com/ but don't say I didn't warn you.
Anyway if anyone can help explain how to with what I have center the text vertically that'd help.
http://70.15.139.117:8181/quake/ should be the link to it on my machine.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>

Last edited by Arenlor : 05-14-2008 at 10:04 PM. Reason: Added the site to view it.
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
When You Register, These Ads Go Away!
Old 05-15-2008, 03:16 AM Re: Vertically aligning text in a div in our favorite browser?
chrishirst's Avatar
Super Moderator

Latest Blog Post:
Javascript alert
Posts: 13,688
Location: Blackpool. UK
http://www.candsdesign.co.uk/referen...ertical-align/
__________________
Chris. ->> Links are advertising NOT optimising!! <<-
Indifference will be the downfall of mankind, but who cares?
Code Samples | People Counting System
chrishirst is offline
Reply With Quote
View Public Profile Visit chrishirst's homepage!
 
Old 05-15-2008, 08:51 PM Re: Vertically aligning text in a div in our favorite browser?
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
Ermm it's working in 3/4 of the browsers I tried, but in the fourth, IE, it doesn't work. I'm trying to figure out what I can do to get it to work in IE.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 05-20-2008, 05:27 PM Re: Vertically aligning text in a div in our favorite browser?
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
Anyone have any help?
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Old 05-20-2008, 06:01 PM Re: Vertically aligning text in a div in our favorite browser?
Gilligan's Avatar
Dead Like Me

Posts: 1,608
Name: Stefan
Location: London, UK
Couldn't you take a different approach and align it with line-height ??

Just a thought
Gilligan is offline
Reply With Quote
View Public Profile
 
Old 05-20-2008, 07:13 PM Re: Vertically aligning text in a div in our favorite browser?
Arenlor's Avatar
Ultra Talker

Posts: 463
Name: Jerod Lycett
Location: /home/arenlor
Hmm, how would that work?
EDIT: Nevermind figured it out. Thanks for the tip.
__________________
PHP Code:
<?php echo "Hello World"?>
HTML Code:
<html><head><title>Hello World</title></head><body><p>Hello World</p></body></html>

Last edited by Arenlor : 05-21-2008 at 12:42 AM. Reason: See above
Arenlor is offline
Reply With Quote
View Public Profile Visit Arenlor's homepage!
 
Reply     « Reply to Vertically aligning text in a div in our favorite browser?
 

Thread Tools

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

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off




   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.12969 seconds with 12 queries