簡體   English   中英

無法插入背景圖片html / css

[英]Can't insert background image html/css

我在向我的網站插入背景時遇到問題。

我使用這種CSS格式:

<body background='imgs/papBG.png' bgproperties='fixed'>
    <img src="Imgs/banner.png" width="100%">
    <div id='cssmenu'>
        <ul>
            <li class='active'><a href='index.html'><span>Página Inicial</span></a></li>
            <li><a href='#'><span>Shows</span></a></li>
            <li><a href='#'><span>Blog</span></a></li>
            <li><a href='#'><span>Loja do Fã</span></a></li>
            <li><a href='#'><span>Perguntas Frequentes</span></a></li>
        </ul>
    </div>
    <div id='budy'>
        <br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br><br>
    </div>

#budy {
        width:1000px;
        margin-left:auto;
        margin-right:auto;
        border-left-style:solid;
        border-right-style:solid;
        border-width:3px;
        background-image: url('imgs/budyBG.png'); /* add quotes, still not working */
        border-bottom-style:solid;
        font-family: Corbel;
        border-bottom-right-radius: 15px;
        border-bottom-left-radius: 15px;
        background-repeat:repeat; /* edited, still not working */
    }

這就是結果,我找不到原因。。。

http://i.imgur.com/2eEk5d9.jpg

或這是某種錯誤,或者我是盲人,看不到我誤會的地方。

編輯:添加了一些更多的代碼,以便你們可以更好地了解該網站

請檢查以確保您的背景圖片已加載。 有時我寫錯了圖像URL,看起來像那樣。

您應該將背景設置為主體本身,以獲得與所附圖片相同的結果

body{
    margin:0;    
    background-image: url(imgs/budyBG.png);
    border-bottom-style:solid;
    background-repeat:repeat-y;
    background-repeat:repeat-x;
}
<!doctype html>
<html>
<head>
    <style>
        body {
            width:1000px;
            height:400px; /* Leave out the <br>'s */
            margin:0 auto;
            border:3px solid #000;
            border-top:0;
            background-image:url('imgs/budyBG.png');
            background-repeat:repeat
            font-family:'Corbel';
            border-radius:0 0 15px 15px;
        }
    </style>
</head>
<body>

</body>
</html>

嘗試這個:

#budy {
        width:1000px;
        margin-left:auto;
        margin-right:auto;
        border-left-style:solid;
        border-right-style:solid;
        border-width:3px;
        background-image:url("img_tree.png");
        background-repeat:no-repeat;
        border-bottom-style:solid;
        font-family: Corbel;
        border-bottom-right-radius: 15px;
        border-bottom-left-radius: 15px;
        background-repeat: repeat;
    }

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM