css實現背景圖展開

來源:互聯網
上載者:User

標籤:des   style   http   color   io   os   使用   ar   for   

製作頁面時,有時需要在表格插入入背景圖,我們可以使用CSS進行控制,代碼:
style="background-image:url(./images/counter_bg.jpg);background-repeat: no-repeat;background-position: right bottom;"
其中,./images/counter_bg.jpg為顯示圖片路徑。

如果現在需要實現背景圖隨表格展開而不重複的展開填充,如何??
製作方法:
建立表格,並在<table>中插入CSS的一種濾鏡,代碼:
style="filter:progid:DXImageTransform.Microsoft.AlphaImageLoader(src=‘‘, sizingMethod=‘scale‘)" 
不過此方法僅支援Ie,並且在ie6中還存在一個問題,就是背景上方的超連結等元素會失效,暫時未找到好的解決方案。如果誰找到了,請留言。

另外,如果需要其他更複雜的效果,建議用層來實現了,利用層的z-index屬性,來實現,幾乎是無所不能啊。例子:
使用層實現的flash背景    <div style="position:relative">
      <EMBED style="position:absolute;z-index:0" src="http://www.68design.net/art/images/flash/20061121001.swf" quality=high width=554 height=121 TYPE="application/x-shockwave-flash" PLUGINSPAGE="http://www.macromedia.com/shockwave/download/index.cgi?P1_Prod_Version=ShockwaveFlash" wmode="opaque">
      <a href=http://www.homelabel.cn/ target="_blank" style="cursor:pointer">
        <div style="position:relative;filter:alpha(opacity=0);-moz-opacity:0;left:0;top:0; background:#CDEAF6;width:554px;height:121px;z-index:10">
        </div>
      </a>
    </div>
附:Css背景參數,用法
序號 中文說明 標記文法
1 背景顏色 { font-family: Verdana, Geneva, Arial, Helvetica, sans-serif; border-color: silver;">2 背景圖片 {background-image: url(URL)|none}
3 背景重複 {background-repeat:inherit|no-repeat|repeat|repeat-x|repeat-y}
4 背景固定 {background-attachment:fixed|scroll}
5 背景定位 {background-position:數值|top|bottom|left|right|center}
6 背影樣式 {background:背景顏色|背景圖象|背景重複|背景附件|背景位置}

css實現背景圖展開

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.