等于valign = center for< p>与css [英] Equivalent of valign=center for <p> with css

查看:151
本文介绍了等于valign = center for< p>与css的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的页面上有以下代码:

I have the following code on my page:

<p align="justify" 
   style="font-size:10pt;display:block;height:200px;vertical-align:middle;"> 
  Content
</p> 

我想让文本垂直对齐在 p 标签

I want the text to be vertically aligned in the center of the p tag

使用 vertical-align:middle 似乎无效。

有办法吗?

推荐答案

方式是将其包装在如下所示的表中:

The easiest way would be to wrap it in a table like so:

<table><tr><td style='vertical-align: middle; height:200px;'>
  <p align="justify" style="font-size:10pt;display:block;"> 
    Content
  </p> 
</td></tr></table>

哦,和 align =justify text-align:justify

这篇关于等于valign = center for&lt; p&gt;与css的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆