Юрий Posted June 7, 2007 Report Share Posted June 7, 2007 Нужно чтобы информация в блоке выравнивалась вертикально по середине. Можно ли такое реализовать без использования таблиц и ява скрипта?Вот как должно работать (IE 6):<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"><html><head> <title>Вертикальное выравнивание</title> <style type="text/css"> #level { background: #c1c1c1; width: 50%; margin: 0px auto; } </style></head><body> <table border=1px width="60%" height="200px"> <tr> <td valign=middle aling="right"> <div id="level">Информация должна быть выровнена вертикально по середине</div> </td> </tr> </table></body></html> Quote Link to comment Share on other sites More sharing options...
0 yopopt Posted June 7, 2007 Report Share Posted June 7, 2007 Задача не ясна. Информация и так выровнена. Quote Link to comment Share on other sites More sharing options...
0 strix Posted June 7, 2007 Report Share Posted June 7, 2007 Существует несколько способов выравнивания в CSS - один из способов и хороший обзор по ссылке http://cssing.org.ua/2007/04/26/another-css-valign-method/Без javascript реализация возможна, однако есть свои ограничения - читайте статью. Quote Link to comment Share on other sites More sharing options...
0 @ndrey Posted June 7, 2007 Report Share Posted June 7, 2007 в стиль добавить line-heigh, значения line-height и width в стиле должны совпадать, т.е. #level { background: #c1c1c1; width: 50px; line-height:50px; margin: 0px auto; } Quote Link to comment Share on other sites More sharing options...
Question
Юрий
Нужно чтобы информация в блоке выравнивалась вертикально по середине. Можно ли такое реализовать без использования таблиц и ява скрипта?
Вот как должно работать (IE 6):
Link to comment
Share on other sites
3 answers to this question
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.