簡體   English   中英

CSS適用於Internet Explorer,但不適用於Chrome或Firefox

[英]CSS works in Internet Explorer but not Chrome or Firefox

為什么下面的代碼在IE中有效,但在Firefox或Chrome中不起作用? 是CSS還是HTML?

CSS

body  {
background-image:url("\images\body_bg.png");
background-repeat: repeat-x;
background-color:#e0dfe4;
background-attachment: scroll;
background-size: auto;
} 

HTML

<!DOCTYPE html>
<html lang="en">
<head>
<meta content="width=device-width, initial-scale=1.0"/>
<title>Program Letters</title>
<link rel="stylesheet" type="text/css" href="../general.css"/>
</head>
<body>...</body>
</html>

這是CSS中的位置問題。 下面修改的代碼修復了它。

 body
{
    background-position: inherit;
    background-image: url("images/body_bg.jpg");
    background-repeat: repeat-x;
    background-color: #e0dfe4;
}

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM