2012-05-23 112 views

回答

1

您定义display:table-cell & position:absolute哪些会产生问题。请删除您的。标题 DIV height

#whats_available .title { 
    position: absolute; 
    z-index: 1000; 
    bottom: 0; 
    left: 0; 
    text-align: center !important; 
    width: 100%; 
    color: #fff; 
} 

入住这http://jsfiddle.net/Rwahk/5/

0

你不应该使用尺寸纯HTML属性(唯一的例外可能是形象,但它仍然是一个坏主意)。

+1

实际上,为图像添加维度属性是加快页面加载速度的好主意。 – BenM

0

我写这可能会派上用场,对您或其他读者这个小jQuery的功能。

jQuery.fn.center = function() { 
    this.css("position","absolute"); 
    this.css("top", (($(window).height() - this.outerHeight())/2) + $(window).scrollTop() + "px"); 
    this.css("left", (($(window).width() - this.outerWidth())/2) + $(window).scrollLeft() + "px"); 
    return this; 
} 

使用:

$(selector).center(); 

享受和一个伟大的日子:)

1

http://jsfiddle.net/Rwahk/7/作品你想...

所做的修改是添加display: table;#whats_available > div并将.title更改为position: relative;

+0

这也适用 - 谢谢你:) –