English 中文(简体)
传真和CSS 背景估算没有显示
原标题:HTML and CSS Background-image is not showing up
  • 时间:2012-01-12 16:48:12
  •  标签:
  • css
  • html
  • web

我已经将我的URL和档案名称进行双重核对,但我似乎无法看到图像。 为什么如此? 我的法典(见<p>在体内,我没有增加全体代码,我只增加了头和具体问题。

<html>
  <head>
     <title>Head First Lounge.</title>
      <link type="text/css" 
            rel="stylesheet" 
            href="stylesheet/style.css" 
            media="screen"/>
  </head>


<p class = "guarantee">
     Our guarantee: at the lounge, we re committed to providing you, 
     our guest, with an exceptional experience every time you visit.
     Whether you re just stopping by to check in on email over an 
     elixir, or are here for an out-of-the-ordinary dinner, you ll 
     find our knowledgeable service staff pay attention to every detail. 
     If you re not fully satisfied, have a Blueberry Bliss Elixir on us.
</p>        

And here s the CSS rule for that part

.guarantee{         
        background-image: url(images/background.gif);
        font-family: "Geogia", "Times New Roman", Times, serif;
        border-color: black;
        border-width: 1px;
        border-style: solid;
        background-color: #a7cece;
            padding: 25px;
            margin: 30px;
            line-height: 1.9em;
            font-style: italic;
            color: #444;
}
最佳回答

为此:

background-image: url(../images/background.gif);

没有<代码>。 因此,你必须回到图像夹所在的目录。

www.un.org/Depts/DGACM/index_russian.htm

.guarantee{
    background: #a7cece url(../images/background.gif);
    border: 1px solid black;
}
问题回答

浏览器目前将在你风格的名录中搜寻图像。

尝试改变

background-image: url(images/background.gif);

to

background-image: url(/images/background.gif);

这可能是问题的根源。

我在把这个问题放在形象的开始之前就已经解决了。

(实例:背景估算:url(/images/background.gif);)

希望:

我知道这一答案是很晚的,但这一联系将给你详细解释档案途径。

/ returns to the root directory
../ moves one directory backwards
../../ moves two directory backwards

https://csss-tricks.com/quick-reminder-about-file-paths/

FYI 这页只是帮助我了解我的问题的解决,我在那里看到了我的 Chrome浏览器的html页,而主角没有装上背景形象,而REASONWAS则因为主角的相对联系在一开始即有/有,正如前面的一些人所说的那样,它触及了Rota 夹,而我的Windows是C:但在服务器上,这是DOES工作的根本所在。 因此,我不得不在 /草场开始时删除这一初步。 jpg链接,然后是ID在窗户上工作。 现在,看看它是否在我的服务器上工作而没有这种闪lash......YUP!

因此,劳动和社会保障部与(或)在(或)/疾病/退场时合作。 jpg in my css on this Service, but onWindows the / , it to the fundamental c:mot. 我在Browser和“Console”的底层使用了“spect”和“Console”来看到它所期待的C:images......,然后用这一回答找到这一页,从现在开始/将其带给ROOT。

愿你们在形象道路上使用后lash(而不是前 forward)。

我犯了这一错误,正在与我的神父争斗。 我复制了视窗探测器的图像途径(它使用后冲斜)。





相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签