一、多重背景圖片
1.background:url() 重復型別 位置資訊,url() 重復型別 位置資訊;
中間使用英文逗號隔開
2.第二種方法就是分開寫
background-image:url(),url();
background-repeat:重復型別,重復型別;
background-positon:位置資訊,?位置資訊;
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>D192_MoreBackgroundImage</title> <style> *{ padding:0; margin:0; } div{ width: 1000px; height: 1000px; border:1px solid black; margin:0 auto; background:url("image/play_tennis.jpg") no-repeat left top, url("image/baidu_logo.png") no-repeat right top; /*注意點:多張背景圖片之間使用逗號隔開,先添加的背景圖片會蓋住后添加的背景圖片*/ /*另外一種方法*/ background-image: url("image/play_tennis2.jpg"),url("image/baidu_logo.png"); background-repeat: no-repeat,no-repeat; background-position: left bottom,right bottom; } </style> </head> <body> <div></div> </body> </html>


二、練習
<!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>D193_ExerciseOfMoreImage</title> <style> *{ padding:0; margin:0; } div{ width: 700px; height: 450px; border:1px solid black; margin:100px auto; background-image: url("image/sun.png"),url("image/blueSky.png"); /*background-size:*/ background-repeat: no-repeat ,no-repeat; background-position: 20px 20px,0 0; animation:move 2s linear 0s infinite normal; } @keyframes move { from{ background-position: 20px 80px,0 0; } to{ background-position: 80px 20px,-200px 0; } ? } </style> </head> <body> <div></div> </body> </html>
?
三、原始碼:
D192_MoreBackgroundImage.html
D193_ExerciseOfMoreImage.html
地址:l
https://github.com/ruigege66/HTML_learning/blob/master/D192_MoreBackgroundImage.html
https://github.com/ruigege66/HTML_learning/blob/master/D193_ExerciseOfMoreImage.html
2.CSDN:https://blog.csdn.net/weixin_44630050
3.博客園:https://www.cnblogs.com/ruigege0000/
4.歡迎關注微信公眾號:傅里葉變換,個人賬號,僅用于技術交流,后臺回復“禮包”獲取Java大資料學習視頻禮包

轉載請註明出處,本文鏈接:https://www.uj5u.com/qiye/51707.html
標籤:Html/Css
上一篇:觀察網站頁面變灰
下一篇:建立個人博客配置推薦
