歡迎來到小豬圈!

Showing posts with label HTML. Show all posts
Showing posts with label HTML. Show all posts

2012-07-31

CSS height:100% 無法佔滿畫面整個高度

  • 結論:連 html 與 body 都要設定 height:100%
  • <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
      "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
    <html>
      <head>
        <title></title>
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
        <style type="text/css">
    html
    {
      height:100%;
    }
    body
    {
      height:100%;
      margin:0;
      padding:0;
    }
    div
    {
      border:1px solid black;
      background:green;
      height:100%;
    }
        </style>
      </head>
      <body>
        <div>long long long long long long long long text with break</div>
      </body>
    </html>

表格(table, td) 的 overflow 屬性無作用

  • 直接記結論如下:
  • table 要加上 table-layout:fixed 的屬性
  • table 要設定寬度 width 的屬性,僅有 td 設定寬度是不夠的!
  • 如果連有空格分隔的段落也要隱藏,則加上 white-space:nowrap
  • 「overflow:hidden」!

標籤分類

Labels

Google Analytics Tracking Code

About Me

My photo
Keelung, R.O.C, Taiwan
一個不學無術、混吃等死的傢伙…