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 07-09-2002, 06:29 PM   PM User | #1
kippie
Regular Coder

 
Join Date: Jul 2002
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
kippie is an unknown quantity at this point
How to align this vertically?

In the HTML below I want to align the text vertically. But I don't know how to do it. Can anyone help?

<html>
<head>
<style type="text/css"><!--
#layer { position: absolute; top: 16px; left: 16px; width: 200px; height: 200px; border-style: dashed; border-color: red; visibility: visible }-->
</style>
</head>
<body>
<div id="layer">this text should be vertically aligned in this layer. But I don't how how to do it. </div>
</body>
</html>

Kippie
kippie is offline   Reply With Quote
Old 07-09-2002, 07:11 PM   PM User | #2
Vladdy
Senior Coder

 
Join Date: Jun 2002
Location: Nashua, NH
Posts: 1,724
Thanks: 0
Thanked 0 Times in 0 Posts
Vladdy is an unknown quantity at this point
#layer
{
...
text-align:center;
...
}
__________________
Vladdy | KL
"Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"
Vladdy is offline   Reply With Quote
Old 07-09-2002, 07:50 PM   PM User | #3
Flamerule
New Coder

 
Join Date: Jun 2002
Location: Paris, France
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Flamerule is an unknown quantity at this point
Vladdy, that align's the text horizontally.

Code:
vertical-align : 50%;
Should work... I'm not sure though.
__________________
I don't suffer from insanity, I enjoy every single minute of it!
Flamerule is offline   Reply With Quote
Old 07-09-2002, 07:52 PM   PM User | #4
kippie
Regular Coder

 
Join Date: Jul 2002
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
kippie is an unknown quantity at this point
Thanks Vladdy,
But I'm afraid you mean horizontal alignment. But I'm looking for vertical alignment.
Kippie
kippie is offline   Reply With Quote
Old 07-09-2002, 07:54 PM   PM User | #5
kippie
Regular Coder

 
Join Date: Jul 2002
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
kippie is an unknown quantity at this point
Thanks Flamerule,
But this doesn't seem to work also. Who can help?
Kippie
kippie is offline   Reply With Quote
Old 07-09-2002, 08:41 PM   PM User | #6
Vladdy
Senior Coder

 
Join Date: Jun 2002
Location: Nashua, NH
Posts: 1,724
Thanks: 0
Thanked 0 Times in 0 Posts
Vladdy is an unknown quantity at this point
oops... excuse my original brainfart....

...ok this works in Gekko browsers as it should....
Code:
#layer 
{ position: absolute;
  display: table-cell;
  vertical-align: middle; 
  top: 16px; 
  left: 16px; 
  width: 200px; 
  height: 200px;
  border-style: dashed; 
  border-color: red; 
  visibility: visible;
 }
but I guess you would have to do this to accomodate the stoopid IE:

Code:
<table id="layer">
<td valign="center">this text should be vertically
 aligned in this layer.
 But I don't how how to do it.
</td>
</table>
__________________
Vladdy | KL
"Working web site is not the one that looks the same on common graphical browsers running on desktop computers, but the one that adequately delivers information regardless of device accessing it"

Last edited by Vladdy; 07-10-2002 at 12:00 AM..
Vladdy is offline   Reply With Quote
Old 07-10-2002, 03:47 PM   PM User | #7
kippie
Regular Coder

 
Join Date: Jul 2002
Posts: 197
Thanks: 0
Thanked 0 Times in 0 Posts
kippie is an unknown quantity at this point
Thanks,
But is there no way to align vertically without using table commands?
Kippie
kippie is offline   Reply With Quote
Old 07-10-2002, 03:55 PM   PM User | #8
Flamerule
New Coder

 
Join Date: Jun 2002
Location: Paris, France
Posts: 47
Thanks: 0
Thanked 0 Times in 0 Posts
Flamerule is an unknown quantity at this point
Quote:
Code:
<table id="layer">
<td valign="center">this text should be vertically
 aligned in this layer.
 But I don't how how to do it.
</td>
</table>
It's <td valign="middle">
__________________
I don't suffer from insanity, I enjoy every single minute of it!
Flamerule 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:25 AM.


Advertisement
Log in to turn off these ads.