css-圖片鋪滿螢幕

來源:互聯網
上載者:User

標籤:

方法一:

 1 <style> 2 *{font-family:微軟雅黑;} 3 img{width:100%;height:100%;position:absolute;top:0;left:0;z-index:-1;} 4 .word{padding-left:15px;padding-right:15px;margin:20px auto;color:#ccc;font-size:15px;} 5 .header{text-align:center;line-height:35px;color:#f60;font-size:24px;} 6 </style> 7  8 </head> 9 <body>10 <img src="bg0.jpg" alt="loginBg">11 <div class="word">12     <div class="header">Hello you</div>13     Your time is limited, so don‘t waste it living someone else‘s life. Don‘t be trapped by dogma - which is living with the results of other people‘s thinking. Don‘t let the noise of other‘s opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.  <br /> -- Steve Jobs14 </div>15 </body>

方法二:

 1 <style> 2 body{background:url(bg2.jpg) no-repeat center top;height:100%} 3 .word{padding-left:15px;padding-right:15px;margin:20px auto;color:#ccc;font-size:18px;} 4 .header{text-align:center;line-height:35px;color:#f60;font-size:24px;} 5 </style> 6  7 </head> 8 <body> 9 <div class="wrap">10     <div class="header">Hello you</div>11     Your time is limited, so don‘t waste it living someone else‘s life. Don‘t be trapped by dogma - which is living with the results of other people‘s thinking. Don‘t let the noise of other‘s opinions drown out your own inner voice. And most important, have the courage to follow your heart and intuition. They somehow already know what you truly want to become. Everything else is secondary.  -- Steve Jobs12 </div>13 </body>

 

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.