关于背景和calc()的一个小问题

问题描述 投票:0回答:1

所有。

我正在做一个项目。我有一个小问题。关于calc函数。

众所周知..它适用于所有浏览器..

========== ok =============

background-color:#dfdfdf;
background-image:url(..);
background-position: calc(100% - 10px) center;
background-repeat: no-repeat;

但为什么下一个代码不能在IE11上运行?

==========不要在IE 11上工作=============

background:#dfdfdf url(..) no-repeat calc(100% - 10px) center;

-_-;;;;;;;;;;;;;;;;

css3 internet-explorer-11 calc background-position
1个回答
0
投票

Ie11必须单独使用

body
     {
background:#dfdfdf url("https://www.w3schools.com/w3css/img_lights.jpg") no-repeat;
background-position:calc(100% - 100px) center;
}
<!DOCTYPE html>
<html>
<head>
     <meta http-equiv="content-type" content="text/html; charset=utf-8">
     <link rel="stylesheet" type="text/css" href="css/style.css">
     <title>Page Title</title>
     <meta name="description" content="Write some words to describe your html page">
   
</head>
<body>


</body>

</html>
© www.soinside.com 2019 - 2024. All rights reserved.