background-image: url(“images/plaid.jpg”) no-repeat; wont show up

前端 未结 6 1242
青春惊慌失措
青春惊慌失措 2021-01-12 14:00

I can\'t seem to make my plaid.jpg the background on any of my pages, let alone all of them, I\'ve tried selecting it by body, html, *, the specific id of \"home\". nothing

6条回答
  •  甜味超标
    2021-01-12 14:52

    You either use :

    background-image: url("images/plaid.jpg");
    background-repeat: no-repeat;
    

    ... or

    background: transparent url("images/plaid.jpg") top left no-repeat;
    

    ... but definitively not

    background-image: url("images/plaid.jpg") no-repeat;
    

    EDIT : Demo at JSFIDDLE using absolute paths (in case you have troubles referring to your images with relative paths).

提交回复
热议问题