我正在嘗試拍攝一張圖像并將其重復顯示在我的網頁頂部,但我什至無法顯示它。我不知道如何正確指定 url。我需要在網站名稱周圍加上單引號。<!DOCTYPE html><html><head><style> html { background: url(fromthehartle.freeservers.com/images/CatTopBorder.gif) no-repeat center fixed; background-size: cover;}body { color: white; }</style></head><body><p>sample text</p></body></html>
2 回答

Smart貓小萌
TA貢獻1911條經驗 獲得超7個贊
我無法顯示您的 GIF,可能是因為它不是通過 https 傳輸的。我在支持 https 的服務器上重新上傳了圖像。您需要從正文中刪除白色,否則您將無法看到文本
<html>
<head>
<style>
html {
background-image: url("https://i.ibb.co/bK2yczN/cat.png");
background-size: cover;
}
</style>
</head>
<body>
<p>sample text</p>
</body>
</html>

30秒到達戰場
TA貢獻1828條經驗 獲得超6個贊
<!DOCTYPE html>
<html>
<head>
<style>
.header {
background-image: url("http://fromthehartle.freeservers.com/images/CatTopBorder.gif");
height:100px;
}
body {
color: white;
}
</style>
</head>
<body>
<div class='header'>
<p>sample text</p>
</body>
</html>
- 2 回答
- 0 關注
- 132 瀏覽
添加回答
舉報
0/150
提交
取消