Html 在底部对齐文本
我发现css/html有一个很难解决的问题。假设我们有一个链接,里面有一个h2,看起来像下面这样 代码如下: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
<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
}