【问题标题】:how to centralize two images and add some text between them [closed]如何集中两个图像并在它们之间添加一些文本[关闭]
【发布时间】:2020-04-07 01:07:55
【问题描述】:

我是初学者。我有两张图片,我厌倦了集中它们并在它们之间添加文本,但似乎没有任何效果。我尝试使用“inline-block”和“position:absolute”。This image might help you to understand what i am trying to do

【问题讨论】:

  • 向我们展示您到目前为止所做的尝试

标签: html css css-position


【解决方案1】:

一种方法是使用弹性盒:

.container {
  display:flex;
  align-items:center;
}
.container span {
  padding: 10px;
}
<div class="container">
  <img src="https://via.placeholder.com/150"/>
  <span>Some text</span>
  <img src="https://via.placeholder.com/150"/>
</div>

【讨论】:

    猜你喜欢
    • 2012-11-19
    • 2013-08-15
    • 2018-12-10
    • 2013-09-15
    • 1970-01-01
    • 2013-09-15
    • 2013-03-18
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多