【问题标题】:css full page background not showing upcss整页背景不显示
【发布时间】:2013-02-25 01:13:37
【问题描述】:

所以我按照 [http://css-tricks.com/perfect-full-page-background-image/][1] 上的教程进行操作 但什么也没有出现!背景是白色的!

这是我的代码:

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Home</title>
    <style type="css/text">
html {
    background: url(images/black-carbon-sheet.jpg) no-repeat center center fixed;
    -webkit-background-size: cover;
    -moz-background-size: cover;
    -o-background-size: cover;
    background-size: cover;
}
    </style>
 </head>
 <body>
 </body>
 </html>

请帮忙! 谢谢!

【问题讨论】:

  • background: url('images/black-carbon-sheet.jpg') 添加引号 ' .
  • 引号是可选的
  • 背景:url("images/black-carbon-sheet.jpg") 试试这个
  • 这对我有用,jsfiddle.net/sperske/3A2Z2 你确定你的图片有你请求的 URL 吗?
  • @AliBassam 报价根本不需要。这不是问题。

标签: css image background


【解决方案1】:

样式type="css/text"不正确

使用

样式 type="text/css" 或完全删除它。

还要确保你的图片路径是正确的

【讨论】:

    【解决方案2】:
    html, body { height: 100%; }
    

    另外,请检查您的路径。

    【讨论】:

      猜你喜欢
      • 2013-07-24
      • 1970-01-01
      • 1970-01-01
      • 2012-04-02
      • 2012-12-11
      • 2019-02-27
      • 2015-02-18
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多