简体   繁体   English

后台重复在Internet Explorer中不起作用

[英]Background-repeat not working in internet explorer

I have found tons of topics about this, but nothing seems to work out. 我发现了很多与此相关的主题,但似乎没有任何结果。

My website consists of a main div, with all the content that takes 80% of the screens width. 我的网站由一个主要div组成,所有内容占用屏幕宽度的80%。 A div with a background is sticked to each side of the div, with a absolute position, like so: 具有背景的div以绝对位置粘贴到div的每一侧,如下所示:

Example of what I mean 我的意思的例子

Now, the side divs have an background-repeat: repeat-y style applied to it. 现在,侧面div具有background-repeat: repeat-y应用了background-repeat: repeat-y样式。 The height of the html is 100%, and what I want works in all browsers, EXCEPT IN INTERNET EXPLORER (even in Edge, but I understood that it processes HTML and CSS differently from IE) (frustrations, sorry). html的高度为100%,我想要的东西在所有浏览器中都可以使用,除了Internet Explorer(甚至在Edge中),但我知道它处理HTML和CSS的方式与IE不同(感到沮丧,对不起)。

The code: 编码:

.bg-left {
    background: transparent url("../images/background/bg_left.png");
    background-repeat: repeat-y;
    position: absolute;
    min-height: 100%;
    width: 100px;
    top: 0;
    left: -100px;
}

.bg-right {
    background: transparent url("../images/background/bg_right.png");
    background-repeat: repeat-y;
    position: absolute;
    min-height: 100%;
    width: 100px;
    top: 0;
    right: -100px;
}

Is there somebody who can help me out? 有没有人可以帮助我?

Thanks in advance 提前致谢

-- JSFIDDLE -- -JSFIDDLE-

https://jsfiddle.net/fwah7gr6/12/ https://jsfiddle.net/fwah7gr6/12/

So, this is the context of my website. 因此,这是我网站的上下文。 There a 'banners' on each side of the website, but what happens in IE, is that those banners stop repeating after you scroll down (it seems like those banners take the height of the screen and not the parent (which is 100% in height). In the JSFiddle this of course works, because that would be normal behaviour. Let's say the page-wrapper has an height of 4000px in total, the banners only take the height of from the top to the bottom of screen height. When I open a console, and push the console up, the banners also get pushed up... 网站的两边都有一个“横幅”,但是在IE中发生的是,当您向下滚动时,这些横幅停止重复(似乎这些横幅占据了屏幕的高度,而不是父屏幕的高度(在屏幕上是100%在JSFiddle中,这当然是可行的,因为那是正常的行为。例如,页面包装器的总高度为4000px,横幅广告的高度仅是屏幕高度的顶部到底部。我打开控制台,然后向上推控制台,横幅也被向上推...

Okay, somehow the framework (Magento 2) I was working in was the problem. 好的,问题出在我正在使用的框架(Magento 2)上。 I did not know this would be a Magento issue, until I saw that Magento adds a .ie10 and .ie11 wrapper around the content with height: 100% . 我不知道这是Magento的问题,直到我看到Magento在height: 100%的内容周围添加了.ie10和.ie11包装器。 Thanks to @Suresh Ponnukalai, which used height: auto , I was able to fix the problem. 感谢@Suresh Ponnukalai,它使用height: auto ,所以我能够解决问题。

My excuses for not mentioning I was working with Magento 2, but I assumed this was pure a HTML/CSS + IE issue. 我没有提及我正在使用Magento 2的借口,但是我认为这纯粹是HTML / CSS + IE问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM