【问题标题】:A small question about background and calc()关于背景和 calc() 的一个小问题
【发布时间】:2018-09-18 01:44:39
【问题描述】:

全部。

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

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

========== 好的==============

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;

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

【问题讨论】:

  • 所以.. IE 的规则对吧?

标签: css internet-explorer-11 calc background-position


【解决方案1】:

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>

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2013-02-09
    • 2016-10-27
    • 2015-08-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多