使用 flexbox 移动元素

问题描述

我无法将 titolo 类中的最后一个 div 向右移动。

在带有 titolo 类的 div 中还有 5 个 div。 这 5 个的最后一个 div 应该向右移动。 我想避免使用边距移动

有人可以帮我吗?

非常感谢!!

JSBin demo

body {
  font-family: 'PT Sans Narrow',sans-serif;
  background-color: black;
}

.bannerSup {
  background-color: black;
  padding: 5px
}

.titolo {
  display: flex;
  font-size: 1.3em;
  padding: 15px;
}

.titolo a {
  color: aliceblue;
  text-decoration: none;
}

div.titolo>div {
  margin-right: 70px;
  margin-bottom: -10px;
}

div.titolo>div>a.contatti {
  color: red;
}

div.titolo>div:nth-child(5) {
  align-self: flex-end;
}

.bannerInf {
  border: 10px solid azure;
  padding: 20px;
  display: flex;
}

#banner1 {
  width: 100%;
}
<div class="bannerSup">
  <div class="titolo">
    <div> <a href="https://www.google.com" target="_blank">PRODottI</a></div>
    <div> <a href="https://www.google.com" target="_blank">ABOUT US</a></div>
    <div> <a href="https://www.google.com" target="_blank">STORY</a></div>
    <div> <a href="https://www.google.com" target="_blank">CONTACTS</a></div>
    <div> <a class="contatti">CONTACTS</a></div>
  </div>

  <div class="bannerInf">
    <img id="banner1" src="https://via.placeholder.com/800x100" alt="Immagine Banner">
  </div>
</div>

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

Selenium Web驱动程序和Java。元素在(x,y)点处不可单击。其...
Python-如何使用点“。” 访问字典成员?
Java 字符串是不可变的。到底是什么意思?
Java中的“ final”关键字如何工作?(我仍然可以修改对象。...
“loop:”在Java代码中。这是什么,为什么要编译?
java.lang.ClassNotFoundException:sun.jdbc.odbc.JdbcOdbc...