如何在同一行上排列3个div? [英] How do I line up 3 divs on the same row?

查看:311
本文介绍了如何在同一行上排列3个div?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有人可以帮我解决这个问题,因为我一直在处理它很长一段时间....

Can someone please help me with this problem as i have been dealing with it for a long time now....

我试图获得3个div相同的行彼此相邻,其中一个div看起来像这样:

I am trying to get 3 divs on the same line next to each other one of the divs looks like this:

<div>  
  <h2 align="center">San Andreas: Multiplayer</h2>  
  <div align="center">
    <font size="+1">  
      <em class="heading_description">15 pence per slot</em>  
    </font>  
    <img src="http://fhers.com/images/game_servers/sa-mp.jpg" class="alignleft noTopMargin" style="width: 188px; ">  
    <a href="gfh" class="order-small">  
      <span>order</span></a>  
  </div>

而其他两个是相同的div,请帮助我获得所有三个div在同一行正确的一个在中间和一个在左边

and the other two are the same divs please help me get all three divs on the same line one on the right one on the mid and one on the left

推荐答案

我惊讶的是没有人提供CSS表布局作为解决方案。

I'm surprised that nobody gave CSS table layout as a solution.

查看 工作演示

HTML: p>

HTML:

<div class="Row">
    <div class="Column">C1</div>
    <div class="Column">C2</div>
    <div class="Column">C3</div>
</div>

CSS:

.Row
{
    display: table;
    width: 100%; /*Optional*/
    table-layout: fixed; /*Optional*/
    border-spacing: 10px; /*Optional*/
}
.Column
{
    display: table-cell;
    background-color: red; /*Optional*/
}

这篇关于如何在同一行上排列3个div?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆