简体   繁体   中英

why the background image only shows in live preview in brackets

I assigned a background image to a section using css and the image only shows up in live preview in brackets. Is this supposed to happen or I did something wrong. Here's The Code:

background: url(/img/background.jpeg) center center no-repeat fixed;
background-size: cover;

Maybe you can try something like this-

img {
border: 1px solid #ddd;
border-radius: 4px;
padding: 5px;}
<img src="example.jpg" alt="example">

Or this-

body {border-style: groove;border-width: 3px; border-color: Black;
         width:1300px; padding: 25px; background-color: Aqua;
     background-image: url("NSIC-logo1.png");
         background-repeat:no-repeat;background-position:50% 10% }

I changed the path to:

background: url(../img/background.jpeg) center center no-repeat fixed;
background-size: cover;

putting the two dots worked for me!!

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM