Html CSS 没有将元素放在同一行

标签 html css

我试图将两个 i 元素放在同一行上。 显示:内联 block ; 似乎没有为此工作。 这是我的 HTML

#gamedesigner-topline {
  position: absolute;
  box-shadow: 0 0 0 2px #ffb141;
  color: #fff;
  transition: color 0.3s;
  display: inline-block !important;
  font-size: 0px;
  margin: 3px 30px 15px;
  width: 180px !important;
  height: 180px !important;
  border-radius: 50%;
  text-align: center;
  position: relative;
  z-index: 1;
  line-height: normal;
  vertical-align: baseline;
  background-image: none;
  background-position: 0% 0%;
  background-repeat: repeat;
  font-family: FontAwesome;
  font-weight: normal;
  font-style: normal;
  text-decoration: inherit;
  -webkit-font-smoothing: antialiased;
  left: 50px;
  background: #FAAC58;
}
#plugin-topline {
  position: absolute;
  box-shadow: 0 0 0 2px #ffb141;
  color: #fff;
  -webkit-transition: color 0.3s;
  -webkit-transition-property: color;
  -webkit-transition-duration: 0.3s;
  -webkit-transition-timing-function: initial;
  -moz-transition: color 0.3s;
  transition: color 0.3s;
  transition-property: color;
  transition-duration: 0.3s;
  transition-timing-function: initial;
  transition-delay: initial;
  display: inline-block !important;
  font-size: 0px;
  margin: 3px 30px 15px;
  width: 180px !important;
  height: 180px !important;
  border-radius: 50%;
  text-align: center;
  position: relative;
  z-index: 1;
  line-height: normal;
  vertical-align: baseline;
  background-image: none;
  background-position: 0% 0%;
  background-repeat: repeat;
  font-family: FontAwesome;
  font-weight: normal;
  font-style: normal;
  text-decoration: inherit;
  -webkit-font-smoothing: antialiased;
  left: 611px;
  background: #FAAC58;
}
.circles {
  display: inline-block;
}
<div class="circles">
  <a id="design">
    <i id="design-topline">
                            <img src="images\Home\designn.png">
                        </i>
  </a>
  <i id="plugin-topline">
                        <img src="images\Home\plugin.png">
                    </i>
</div>

有了这个 CSS 和 HTML,一个圆圈就按照我想要的方式定位在屏幕的左侧。然而,第二个圆圈在我想要的屏幕的正确一侧,但似乎比第一个圆圈低很多,不在同一条线上。我怎样才能让这个圆圈与第一个圆圈在同一条线上。我称它为圆圈,因为这就是 CSS 使 i 元素变成的样子。

最佳答案

将#plugin-topline 的位置更改为相对位置,然后调整位置标志。

display: relative;

关于Html CSS 没有将元素放在同一行,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/28913156/

相关文章:

javascript - 追加后淡入不工作

css - 如何仅向没有链接的图标添加样式?

javascript - 通过jquery的背景颜色

HTML5 和 CSS3 : How can I make sure that my code is compatible to all browsers?

javascript - 制作图像 slider 但背景图像不会响应其他属性?

html - 相对路径不适用于自定义字体

html - 背景 img 宽度由里面的文本控制。高度保持不变

javascript - 删除 Zurb Foundation 内联样式

css - 如何在另一个 HTML 类中调用一个 HTML 类?

javascript - Bootstrap Modal 未正确执行