不工作

时间:2013-09-09 01:05:09

标签: html css html5 css3

我正在通过将CSS,图像等放入相应的文件夹来清理我的网络投资组合目录。

<link rel="stylesheet" href="css/style.css">
<link rel="stylesheet" href="css/contact.css">

但是,如果我的CSS文件位于目录中,我似乎无法加载某些DIV元素。

DIV如下:

#contact-form-wrap {
    width: 1024px;
    margin: 0 auto;
    background: url('img/form-bg.png')  no-repeat;
    min-height: 768px;
}

有没有办法解决这个问题?除了上面的div之外,其他所有内容似乎都会加载。

3 个答案:

答案 0 :(得分:2)

试试这个......

#contact-form-wrap {
  width: 1024px;
  margin: 0 auto;
  background: url(../img/form-bg.png)  no-repeat;
  min-height: 768px;
}

答案 1 :(得分:1)

使用#contact-form-wrap时,请确保您使用的是ID而不是类。这是我唯一能想到的。

示例:

不正确:

<div class="contact-form-wrap"></div>

正确:

<div id="contact-form-wrap"></div>

答案 2 :(得分:0)

不要忘记将type="text/css"添加到您的css声明中,如下所示:

<link rel="stylesheet" type="text/css" href="css/style.css">
<link rel="stylesheet" type="text/css" href="css/contact.css">