小编Tal*_*rah的帖子

将一个元素居中并将另一个元素右对齐在同一行上

我有两个盒子.一页在左侧,另一页在页面右侧.

左边的那个有登录+注册.

右边一个有两个图像.

我试图将左边的一个对齐到页面的中心,其内容水平对齐,即一行.

我正在尝试将正确的框放到页面的右侧,其内容也在一行上.

我的小提琴

#topjob {
  width: 100%;
  text-align: center;
}
#left {
  float: left;
  width: 500px;
  height: 50px;
  background: #ff0000;
}
#right {
  width: 100%;
  display: inline-block;
  margin-right: auto;
  margin-left: 100px;
  width: 100px;
  height: 50px;
  background: #00ff00;
}
#center ul li {
  float: right;
  width: 200px;
  height: 50px;
  background: #0000ff;
}
Run Code Online (Sandbox Code Playgroud)
<div class="header_top">
  <!--header_top-->
  <div class="container">
    <div class="row">
    </div>
    <div id="topjob">
      <div id="left">
        <ul>
          <li><a href="#"><i class=""></i>LOGIN</a>
          </li>
          <li><a href="#"><i class=""></i>REGISTER</a>
          </li>
        </ul>
      </div>
      <div id="right">
        <ul> …
Run Code Online (Sandbox Code Playgroud)

html css css3 flexbox

5
推荐指数
1
解决办法
3065
查看次数

标签 统计

css ×1

css3 ×1

flexbox ×1

html ×1