如何在div中创建多个列 [英] How to create multiple columns in a div

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

问题描述

我想知道如何在div中创建多个列。

I was wondering how I would create multiple columns in a div. It's for a footer and I want a site map, links to social media etc.

我要使用< multicol>

基本上我有一个80%宽的DIV,我需要三列在里面。

Basically I have an 80% wide DIV and I need three columns in it. Preferably each with a margin.

Css:

 div.bottom
        {
            height: 200px;
            width: 80%;
            margin-left: auto;
            margin-right: auto;
            margin-top: none;
            margin-bottom: none;
            border-top: 4px solid #00ccff;
            border-bottom-left-radius: 15px;
            border-bottom-right-radius: 15px;
            background-color: #575757;
        }

我现在只需要HTML。

I just need the HTML now. Thank you for your time.

推荐答案

使用 float:left; (或右),并给它们一个确切的宽度

Create three divs with float: left; (or right) and give them an exact width.

<div class="bottom">
  <div style="float: left; width: 33%;"></div>
  <div style="float: left; width: 33%;"></div>
  <div style="float: left; width: 33%;"></div>
</div>

查看行动

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

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