首页
学习
活动
专区
工具
TVP
发布
社区首页 >问答首页 >如何在div内垂直对齐span ?

如何在div内垂直对齐span ?

提问于 2018-03-12 00:25:10
回答 2关注 0查看 242
代码语言:txt
复制
<div class="container">

    <span>Some text, yay</span>

</div>

<div class="container">

    <span>Some text, yay. But shit time, there is alot of text, so we get a problem with breaking lines and the given height :( How can I align vertical now?</span>

</div>
<style>
.container {
    width: 100%;
    height: 50px;
    line-height: 50px;
    border: 1px solid black;
}

.container span {
    padding-left: 30px;
}
</style>

回答

和开发者交流更多问题细节吧,去 写回答
相关文章

相似问题

相关问答用户
领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档