为什么背景图像仅在括号中的实时预览中显示

时间:2016-06-19 12:08:49

标签: html css adobe-brackets

我使用css为一个部分指定了背景图像,图像仅显示在括号中的实时预览中。这应该发生还是我做错了什么。这是“守则”:

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

2 个答案:

答案 0 :(得分:0)

也许你可以试试这样的东西 -

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

或者这个 -

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% }

答案 1 :(得分:0)

我将路径更改为:

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

把两个点放在我身上!!