简体   繁体   English

绝对定位的div跳到IE7中包含div的外部

[英]Absolute positioned div jumps outside containing div in IE7

Having trouble with a couple of display issues in IE7. 在IE7中遇到一些显示问题。

Firstly, my large text headers display too far up in Internet Explorer (all pages) Secondly, my descriptions on my Portfolio pages end up outside their containing divs. 首先,我的大文本标题在Internet Explorer(所有页面)中显示的太远了;其次,我在“投资组合”页面上的描述最终超出了它们所包含的div。

Works great on FF/Chrome/Opera/Safari though! 不过,在FF / Chrome / Opera / Safari上效果很好! You'll see what I mean: http://bit.ly/a3hUD4 (I've used bitly so my dumb questions don't show up when someone googles my website). 您会明白我的意思: http : //bit.ly/a3hUD4 (我用过一点,所以当有人用谷歌搜索我的网站时,我的愚蠢问题就不会出现)。

I've googled extensively. 我已经在Google上进行了广泛的搜索。 Not sure if problem number 2 is a overflow issue, or a absolute positioning bug in IE. 不确定问题2是溢出问题还是IE中的绝对定位错误。

Here's the CSS for the centre div with the jumbo-text titles 这是带有巨型文本标题的中心div的CSS

.column1 {
padding: 103px 10px 10px 10px;
float: left;
width: 500px;
margin: 0;
}

And for the description div on the portfolio page 对于投资组合页面上的描述div

.porttxtbox {
text-align: right;
background-image: url(images/porttxtBG.png);
bottom: 0;
position: absolute;
width: 100%;
padding: 0px;
margin: 0px;
}

And it's container div 这是容器div

.portimgbox {
    padding: 0px;
    margin: 0px;
    height: 250px;
    width: 480px;
    position: relative;
    border: 5px solid #EAEAEA;

Thanks in advance! 提前致谢!

EDIT: Now that I notice, it's not just my jumbo page titles in column1, ALL of my columns are about 6 or 7 px higher than they are in webkit/gecko browsers. 编辑:现在我注意到,这不仅仅是我在column1中的巨型页面标题,我的所有列都比在webkit / gecko浏览器中高6或7 px。 Any ideas? 有任何想法吗?

Heading Margins 标题边距

try with this 试试这个

<meta http-equiv="X-UA-Compatible" content="IE=EmulateIE7" />

The <p></p> Tag with attribute line-height could not be rendered well in ie 7 or min version 具有line-height属性的<p></p>标记在7或最小版本中无法很好地呈现

Removing or replacing tag with a div could solve the problem, if problem persist you can use the gif spacer.. alway works :P 删除或替换为div的标签可以解决问题,如果问题仍然存在,可以使用gif分隔符。

Absolute Position 绝对位置

ops.. I forgot try to add in .porttxtbox left:0; 我忘记尝试在.porttxtbox中添加left:0;

Is better for specification typing the orizontal rule left:0; 更好地规范键入left:0;规则left:0; of a position:absolute, so there is no rendering fail with some browser, see ie7 or min version. 绝对位置,因此在某些浏览器中不会出现渲染失败的情况,请参见ie7或min版本。

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

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