最近中文字幕高清中文字幕无,亚洲欧美高清一区二区三区,一本色道无码道dvd在线观看 ,一个人看的www免费高清中文字幕

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

關(guān)于css中的background的一些測試,不知道為什么會這樣?

關(guān)于css中的background的一些測試,不知道為什么會這樣?

flyingjoer 2015-12-20 10:19:38
<!--一個頁面的根源素是html元素,但是body元素才是內(nèi)容部分,但是給body設(shè)置background-color或者單純的設(shè)置一個background-image的話,卻會影響整個頁面,即便是body有一個默認的外邊距,即便在瀏覽器中顯示的body的高度只有150px;但是它也會渲染整個屏幕。但是如果通過background-position進行定位,同時使用background-repeat禁止重復,那么背景圖片就只會影響body這個盒子。--> <!DOCTYPE?html> <html> <head> <style> body?{ ????background-color:?aqua; ????background-image:?url("http://www.w3schools.com/css/img_tree.png"); ????background-repeat:?no-repeat; ????background-position:?left?bottom; ????margin-right:?200px; ????border:?3px?solid?black; } p{ background-color:?#fff; } </style> </head> <body> <h1>Hello?World!</h1> <p>W3Schools?background?no-repeat,?set?position?example.</p> <p>Now?the?background?image?is?only?shown?once,?and?positioned?away?from?the?text.</p> <p>In?this?example?we?have?also?added?a?margin?on?the?right?side,?so?the?background?image?will?never?disturb?the?text.</p> </body> </html>
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 1649 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學習伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號