English 中文(简体)
Fixed positioned div with a fixed height and relative or absolute divs inside it with greater height
原标题:

I have a problem with IE.

I have a fixed div like this:

#fixed {
position: fixed;
top: 0px;
left: 0px;
z-index: 9998;
width: 100%;
height: 40px;
}

Inside this div I want to place another div that has a height that is higher than its holder (higher than 40px). So I put a relative or an absolute div inside it and it works splendid in all browsers except IE, at least IE8.

But in IE8 the child div gets cut because of the height of 40px specified for it s holder.

Is there any workaround to this problem? I m starting to get gray hairs..

最佳回答

Quick reply: have you tried setting the clip property of the contained div to it s own size?

Another workaround would be (if, say you have a container div with left/right margins auto and position: relative) to have the second div outside the fixed div in your HTML, then position it fixed within the container div instead - since it s also fixed, you can then set top/bottom and left/right positions to suit.

问题回答

暂无回答




相关问题
Why doesn t "doScroll" work in IE8?

Is "doScroll" still supported by Microsoft in IE8? I can t get it to work at all. Here s a test page: <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN""http://www.w3.org/TR/html4/...

IE8 focus pseudo class and Sibling Selector

I have some mark up and I am trying to have the "hints for some input" light up when the accosicated text input has focus. I am trying to use the focus pseudo class along with a sibling selector. If i ...

IE errors with jQuery & timeout

In a jquery hover event I use the following code to drop down a menu: clearTimeout(hTimeout); $( #lowermenu ).queue( fx , []); $( #menucenter .current ).removeClass( current ); $(this).children( a )....

IE8 Session sharing problem in ASP .Net Application

I am having ASP .Net application which is running perfectly in IE 7.0 but as due to session sharing in IE 8.0 (also in case of new window), application is giving unexpected behavior as session can be ...

ASP.NET - Issues with position of controls in IE8

recently I ve moved on to testing my web aplication in IE8, however, I ve noticed that the position of my controls now all over the place. This was not apparent when I was testing my app with IE7 and ...

Internet Explorer, How to change iframes src

For some reasons I m using an Iframe to display googlemaps, when I want to change it s content I m just changing the Iframe src using JQuery. $( #ggMap ).attr( src , http://newurl.com ); Apparently ...

IE8 Javascript doesnt run unless Developer Tools is open?

For some reason, in IE8, javascript is not running unless I reload the page with Developer Tools open. I close developer tools and reload the page and the javascript stops working. I m not getting any ...

热门标签