第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號(hào)安全,請(qǐng)及時(shí)綁定郵箱和手機(jī)立即綁定

關(guān)于編程挑戰(zhàn)

為什么我改變內(nèi)邊距padding的值時(shí)圖片會(huì)變形?比如我把內(nèi)邊距1改為10px圖片就受到影響了?

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>圖片背景</title>

<style type="text/css">

body{ margin:0;}

div{background:#460E29;width:700px;padding:20px}

img{ background:url(http://img1.sycdn.imooc.com//5385ac820001905201440133.jpg); padding:1px 20px 37px 30px;}

</style>

</head>

<body>

<div><img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" /><img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" /><img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" /><img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" /> </div>

</body>

</html>


正在回答

4 回答

這道題里面那四張圖片是一瓶香水(指甲油)加上一個(gè)大概95*95的白色背景,而給這幾張圖片加的背景是最后效果圖中的花邊和一個(gè)白色的大約95*95的框。不給圖片加padding的時(shí)候,背景被圖片擋住了,所以就顯示圖片。加了padding之后就顯示一部分背景。如果按照題里面說的{}padding:1px 20px 37px 30px;},正好可以顯示背景。如果把1px變成10px,那張背景就開始循環(huán)了,而且你的圖片的白框和背景的白框就不重合了,所以上面多了一個(gè)白條,下面多了一個(gè)白條。希望我說明白了。。

3 回復(fù) 有任何疑惑可以回復(fù)我~
#1

everymoment3674130 提問者

非常感謝!
2016-09-24 回復(fù) 有任何疑惑可以回復(fù)我~

img{ margin-right:10px; background:url(http://img1.sycdn.imooc.com//5385ac820001905201440133.jpg); padding:1px 20px 37px 30px;}


0 回復(fù) 有任何疑惑可以回復(fù)我~

圖片不是變形了,是你的背景圖片多出來的白色背景是img的背景圖片

0 回復(fù) 有任何疑惑可以回復(fù)我~

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

<head>

<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />

<title>圖片背景</title>

<style type="text/css">

body{ margin:0;}

div{background:#460E29;width:700px;padding:20px}

img{background-image:url(http://img1.sycdn.imooc.com//5385ac820001905201440133.jpg); padding:0 25px;}


</style>

</head>

<body>

<div>

? ? <img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" />

? ? <img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" />

? ? <img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" />

? ? <img src="http://img1.sycdn.imooc.com//5385acb000013b0d00950095.jpg" />?

</div>

</body>

</html>


0 回復(fù) 有任何疑惑可以回復(fù)我~

舉報(bào)

0/150
提交
取消
網(wǎng)頁簡(jiǎn)單布局之結(jié)構(gòu)與表現(xiàn)原則
  • 參與學(xué)習(xí)       108284    人
  • 解答問題       395    個(gè)

入門必殺技之結(jié)構(gòu)與表現(xiàn)相分離,課程會(huì)有3個(gè)案例,不同角度講解

進(jìn)入課程

關(guān)于編程挑戰(zhàn)

我要回答 關(guān)注問題
微信客服

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

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動(dòng)學(xué)習(xí)伙伴

公眾號(hào)

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