English 中文(简体)
离婚时的友好文本
原标题:Vertically Align Text Within Floating Div
  • 时间:2012-01-12 18:29:26
  •  标签:
  • html
  • css

我在另一个散射集装箱内有四伏右浮。 在右浮层一米显示器(日期/时间)内。 我如何在不使用上层婚礼的情况下纵向调整案文? 当我用上层dding时,它会把我 d倒下来,然后它就不再放在集装箱内。 感谢!

最佳回答

在座标上,在您的集装箱上使用线载荷。 您的班轮值与集装箱高度相同。 这应当使你的案文纵向一致。

如果div为hal:50px; than Addline-hala:50px;

问题回答

这里的一个例子是,在权利上增加了浮动的DIV,并将案文纵向和横向地集中起来。

http://jsfiddle.net/johnpa/pUr6T/

The trick here is to set the line-height of the element to be the full height of its container.

<div id="outerDiv">
    <div id="rightFloatingDiv">
        <p>Hello</p>
    </div>
    <p>Lorem ipsum dumsome Lorem ipsum dumsome Lorem ipsum </p>
</div>

#outerDiv{
    width:400px;
    height:400px;
    background:#EEAAEE;
}
#rightFloatingDiv{
    width:100px;
    height:100px;
    line-height:100px;
    background:#EEEEEE;
    float:right;
}
#rightFloatingDiv > p{
    width: 100%;
    height: 100%;
    line-height:inherit;
    background:yellow;
    vertical-align:middle;
    text-align:center;
}




相关问题
CSS working only in Firefox

I am trying to create a search text-field like on the Apple website. The HTML looks like this: <div class="frm-search"> <div> <input class="btn" type="image" src="http://www....

image changed but appears the same in browser

I m writing a php script to crop an image. The script overwrites the old image with the new one, but when I reload the page (which is supposed to pickup the new image) I still see the old one. ...

Firefox background image horizontal centering oddity

I am building some basic HTML code for a CMS. One of the page-related options in the CMS is "background image" and "stretch page width / height to background image width / height." so that with large ...

Separator line in ASP.NET

I d like to add a simple separator line in an aspx web form. Does anyone know how? It sounds easy enough, but still I can t manage to find how to do it.. 10x!

热门标签