Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/33.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 在底部对齐文本_Html_Css - Fatal编程技术网

Html 在底部对齐文本

Html 在底部对齐文本,html,css,Html,Css,我发现css/html有一个很难解决的问题。假设我们有一个链接,里面有一个h2,看起来像下面这样 代码如下: <a href="newLink"><h2>This can be one line or two lines or three..</h2></a> HTML <div> <h2>one line</h2> <h2>This can be one line or two line

我发现css/html有一个很难解决的问题。假设我们有一个链接,里面有一个h2,看起来像下面这样

代码如下:

<a href="newLink"><h2>This can be one line or two lines or three..</h2></a>
HTML

<div>
 <h2>one line</h2>
   <h2>This can be one line or two lines or three..</h2>
</div>

HTML

<div>
 <h2>one line</h2>
   <h2>This can be one line or two lines or three..</h2>
</div>

HTML

<div>
 <h2>one line</h2>
  <h2 align=center>This can be one line or two lines or three..</h2>
</div>
编辑了中心对齐的Sowmya演示

HTML

<div>
 <h2>one line</h2>
  <h2 align=center>This can be one line or two lines or three..</h2>
</div>

编辑了中心对齐的Sowmya演示

我解决了它使用垂直对齐:底部;显示:表格单元格我还没有用所有浏览器测试它。我用垂直对齐:底部;显示:表格单元格我还没有使用所有浏览器测试它。
div{background:grey; width:100%}
h2{
  font-size:20px; 
  color:white; width:49%; 
  display:inline-block
}