歡迎來到小豬圈!

2013-09-05

IE10 開啟 localhost 會停頓的問題

2013-08-31

CSS 以圖取代文字

  • 用 CSS 將文字以底圖取代,實例可參考 CSS Zen Garden
  • 另外還得考量無障礙 (Accessibility) 和搜尋引擎最佳化 (SEO)



  1. display: none

    <h1><span>Headline 1</span></h1>
    h1{
      background: url(headline1.png);
      width: 200px;
      height: 100px;
    }
    h1 span{
      display:none;
    }
    • 需要額外的元素
  2. visibility: hidden

    <h1><span>Headline 1</span></h1>
    h1{
      background: url(headline1.png);
      width: 200px;
      height: 100px;
    }
    h1 span{
      visibility: hidden;
    }
    • 基本上和 display:none; 一樣,只是有佔空間
  3. text-indent: -9999px

    <h1>Headline 1</h1>
    
    h1{
      background: url(headline1.png);
      width: 200px;
      height: 100px;
      white-space: nowrap; /* 設為不換行,使內容集中在一行 */
      text-indent: -9999px;
    }
    • 好處是不需要額外的標籤

  4. text-indent: 100%;

    <h1>Headline 1</h1>
    
    h1{
      background: url(headline1.png);
      width: 200px;
      height: 100px;
      white-space: nowrap; /* 設為不換行,使內容集中在一行 */
      text-indent: 100%;
      overflow: hidden;
    }
    • 同上,但可避免讓瀏覽器建立一個大而無用的格子

2013-03-28

開啟 ASP.NET 除錯

  • 這是在修改遠端 ASP.NET 網站遇到的問題,伺服器預設會避免顯示詳細的錯誤資訊並導向錯誤訊息面頁,立意良善但要除錯就麻煩了…
  • 修改 web.config :
    <?xml version="1.0"?>
    <configuration>
      <system.web>
        <customErrors mode="Off"/>
        <compilation debug="true">
        </compilation>
      </system.web>
    </configuration>

2013-02-09

Chrome 會自動啟用 Flash plug-in


標籤分類

Blog Archive

Labels

Google Analytics Tracking Code

About Me

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