div如图所示的格式怎么实现

发布网友 发布时间:2022-04-22 14:09

我来回答

2个回答

热心网友 时间:2023-09-21 02:39

这种页面的布局,应该是前端开发最基本的页面布局方式了,一般考察的是元素标签及浮动的应用。代码格式如下:

<style type="text/css">
               *{margin:0;padding:0}
            .content{ width:900px; overflow:hidden }
            .box{width:260px; margin-right:10px; float:left}
            .box_footer{ padding-left:10px; padding-right:10px; padding-top:10px;
             padding-bottom:10px; }
</style>

<div class="content">
            <div class="box">
                        <div class="box_content">
                                <img src="图片路径">
                                <div class="box_footer">
                                        <p>内容内容内容内容内容内容</p>
                                        <p>2018-05-17</p>
                                </div>
                        </div>
            </div>
            
            <div class="box">
                        <div class="box_content">
                                <img src="图片路径">
                                <div class="box_footer">
                                        <p>内容内容内容内容内容内容</p>
                                        <p>2018-05-17</p>
                                </div>
                        </div>
            </div>
        
            <div class="box">
                        <div class="box_content">
                                <img src="图片路径">
                                <div class="box_footer">
                                        <p>内容内容内容内容内容内容</p>
                                        <p>2018-05-17</p>
                                </div>
                        </div>
            </div>
</div>

备注:没有做测试,大致样式应该如此,个人需要做一定调整,给你留点空间,自我学习更重要!!

热心网友 时间:2023-09-21 02:39

很基本的DIV+CSS布局,如果用表格来做的话就更简单了。追问能写一下基本样式代码吗?先谢谢大神了

声明声明:本网页内容为用户发布,旨在传播知识,不代表本网认同其观点,若有侵权等问题请及时与本网联系,我们将在第一时间删除处理。E-MAIL:11247931@qq.com