开发者社区> 问答> 正文

, 如下图所示的 css 布局, 该怎么写, 只要4个DIV, 不要任何别的嵌套

screenshot
css 布局, 该怎么写, 只要4个DIV, 不要任何别的嵌套,求指导

展开
收起
杨冬芳 2016-06-06 13:16:59 2308 0
1 条回答
写回答
取消 提交回答
  • IT从业

    <style type="text/css">
            .box{
                width:380px;
                height: 60px;
                background-color: gray;
            }
            .icon{
                width:20%;
                height:98%;
                border: 1px solid red;
                float: left;
                display:inline-block;
            }
            .icon2{
                width:58%;
                height:40%;
                border: 1px solid red;
                display:inline-block;
                margin-top: 2px;
            }
            .icon3{
                width:20%;
                height:98%;
                border: 1px solid red;
                display:inline-block;
                float: right;
                text-align: center;
                line-height: 60px;
                vertical-align: center
            }
        </style>
    <!-- html -->
    <div class="box">
            <div class="icon">
                <img width="100%" height="100%" alt="" src="../img/icon_138.png">
            </div>
            <div class="icon3">关注</div>
            <div class="icon2">啊大大大阿发</div>
            <div class="icon2">爽肤水发发发啊</div>
        </div>
    2019-07-17 19:28:18
    赞同 展开评论 打赏
问答排行榜
最热
最新

相关电子书

更多
零基础CSS入门教程 立即下载
低代码开发师(初级)实战教程 立即下载
阿里巴巴DevOps 最佳实践手册 立即下载