Jump to content

lolka84

User
  • Posts

    231
  • Joined

  • Last visited

  • Days Won

    2

Everything posted by lolka84

  1. Тему смотрел, случаев, похожих на мой, не увидел
  2. Как правильно расположить подвал, что б он всегда был под дивом main ? Просто засунуть его в сам main под див center не вариант, т.к. подвал должен быть растянут на всю ширину браузера. Хелп плз, заранее спасибо! <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=windows-1251"> <title>Документ без названия</title> <style type="text/css"> body,html { width:100%; height:100%; min-width:780px; position:absolute; } #main { width:94%; height:auto; min-height:370px; margin:0 3%; position:absolute; background-color:#eee; } #menu { width:100%; height:50px; position:absolute; background-color:#ddd; } #center { width:100%; height:auto; min-height:320px; position:absolute; top:50px; background-color:#ccc; } #footer { width:100%; height:80px; background-color:#bbb; } </style> </head> <body> <div id="main"> <div id="menu"> </div> <div id="center"> </div> </div> <div id="footer"> </div> </body> </html>
  3. Привет window.onload = function () { var wheight = (window.innerHeight) ? window.innerHeight : ((document.all) ? document.body.offsetHeight : null); document.getElementById("center_v").style.height = (document.getElementById("content").scrollHeight - 50)+"px"; document.getElementById("center_v").style.width = (document.getElementById("content").scrollWidth)+"px"; } #content { width:56%; min-height:500px; margin:0 0 0 0; padding:50px 2% 0 2%; float:left; } * + html #content { width:55%; } #center_v { width:100%; height:100%; min-height:500px; display:table-cell; vertical-align:middle; } #center_h { width:100%; height:auto; text-align:center; font-size:13px; color:#888; } <div id="content"> <div id="center_v"> <div id="center_h"> Текст </div> </div> </div> Можно может это реализовать без участия js ? Как заставить display:table-cell; центрироваться по вертикали, если высота задана в процентах ?
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue. See more about our Guidelines and Privacy Policy