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 gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to align text vertically in layer?

Status
Not open for further replies.

kippie

Technical User
Nov 8, 2001
158
In the HTML below I want to align the text vertically. But I don't know how to do it. I know it can be done by putting a table cell in the div but I would like to know if it's possible without table commands? Can anyone help?

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

Kippie

 
Try this. It should work for most versions of both NS and IE.

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

Rick If I have helped you just click the first link below to let me know :)
 
Well, it doesn't work IE6.
Kippie
 
Oh, too bad. That's only for tds that you can use valign. Sorry.

Rick If I have helped you just click the first link below to let me know :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top