开发者

CSS background-image problem

开发者 https://www.devze.com 2023-03-08 19:00 出处:网络
I am writing <div id=\"my_div\"> Hello </div> and when I put #my_div { background-image:url(../images/material_bot.png)

I am writing <div id="my_div"> Hello </div> and when I put

#my_div
{
    background-image:url(../images/material_bot.png)
    background-repeat: no-repeat;
}

then the开发者_如何学Python background does not figure, but when I remove the background-repeat: no-repeat; the I see the background image repeating to right and down.

What is the problem?


You're missing the ; from the end of the first line, so your CSS won't get read correctly. See if adding the semi-colon at the end of the first line fixes it.

#my_div
{
    background-image:url(../images/material_bot.png); /* <-- Semicolon added here */
    background-repeat: no-repeat;
}
0

精彩评论

暂无评论...
验证码 换一张
取 消