.clearFix:after{visibility: hidden;display: block;font-size: 0;content: '.';clear:both;height: 0;}
<!DOCTYPE html> <head> <meta http-equiv="Content-Type" content="text/html; charset=utf-8"/> <style> html,body{ height:100%; } .container{ height: 100%; position: relative; } .content{ padding-bottom:60px; } .footer{ width: 100%; height: 60px; background: #ccc; position: absolute; bottom: 0; } </style> </head> <body> <div class="container"> <div class="header"> this is header </div> <div class="content"> this is content </div> <div class="footer"> This is footer </div> </div> <script type="text/javascript"> </script> </body> </html>
以table td为例
table{ table-layout: fixed; } table>tbody>tr>td{ text-overflow: ellipsis; overflow: hidden; white-space: nowrap; /*强制一行显示所有内容*/ }
悬浮显示
table>tbody>tr>td:hover{ overflow: visible; white-space: normal; }
parent.document.all('staffList').style.height = document.body.scrollHeight + 'px';
document.addEventListener("DOMContentLoaded",function(){ var elem=document.getElementById("#id"); elem.style.height = elem.style.scrollHeight + "px"; },false)
$('iframe').contentWindow.document;
Number.prototype.padLeft = function(base,chr){ var len = (String(base || 10).length - String(this).length)+1; return len > 0? new Array(len).join(chr || '0')+this : this; } var d = new Date, dformat = [ (d.getMonth()+1).padLeft(), d.getDate().padLeft(), d.getFullYear()].join('-')+ ' ' + [ d.getHours().padLeft(), d.getMinutes().padLeft(), d.getSeconds().padLeft()].join(':');