[英]Vertically align text to the top beside another text
I am having a div with various texts.我有一个包含各种文本的 div。 I need to make the am and pm on the top.
我需要把上午和下午放在顶部。
My HTML code is-我的 HTML 代码是-
<div class="agendaBlackDiv">
<span class="agendaTimeStop">10:00</span >
<span>a.m.</span>
<text>-</text>
<span class="agendaTimeStop">11:30</span>
<span>p.m.</span>
</div>
Here is JSfiddle link- Fiddle Link这是 JSfiddle 链接-小提琴链接
Just change your css class from只需将您的 css 类从
text
{
color:white;
}
to到
text
{
color:white;
vertical-align: top;
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.