怎么写DIV和CSS

用DIV和CSS写,不要用表格。还有那个包装机械和更多上面还有边框哦。。。看清楚一点。... 用DIV和CSS写,不要用表格。还有那个包装机械和更多上面还有边框哦。。。看清楚一点。 展开
 我来答
lord_dy
2009-04-30 · TA获得超过101个赞
知道答主
回答量:49
采纳率:0%
帮助的人:62.3万
展开全部

<html>

    <head>

        <style type="text/css">

            .machine {

                font-size: 12px;

            } .title {

                height: 21px;

                width: 420px;

                margin: 1px 1px -1px 1px;

                border-style: solid;

                border-width: 1px;

                border-color: #CFCFCF;

            } .title_l {

                padding: 2px;

                float: left;

            } .title_r {

                padding: 2px;

                float: right;

            } .table {

                width: 424px;

            } .table span {

                margin: 1px;

                padding: 2px;

                float: left;

                display: block;

                width: 100px;

                text-align: center;

                background-color: #CAE1FF;

            } .clear {

                clear: both;

            } .comment {

                font-size: 8px;

                color: #8B7500;

            }

        </style>

    </head>

    <body>

        <div class="machine">

            <div class="title">

                <span class="title_l">包装机械</span>

                <span class="title_r">更多</span>

            </div>

            <div class="clear">

            </div>

            <div class="table">

                <span>打包机<em class="comment">HOT</em></span>

                <span>真空包装机</span>

                <span>封装机</span>

                <span>缠绕机</span>

                <span>贴标机</span>

                <span>收缩机</span>

                <span>纸箱成型机</span>

                <span>套袋包装机</span>

                <span>装盒机</span>

                <span>装箱机</span>

            </div>

            <div class="clear">

            </div>

            <div class="title">

                <span class="title_l">包装机械</span>

                <span class="title_r">更多</span>

            </div>

            <div class="clear">

            </div>

            <div class="table">

                <span>打包机</span>

                <span>真空包装机</span>

                <span>封装机</span>

                <span>缠绕机<em class="comment">HOT</em></span>

                <span>贴标机</span>

                <span>收缩机</span>

                <span>纸箱成型机</span>

                <span>套袋包装机<em class="comment">HOT</em></span>

                <span>装盒机</span>

                <span>装箱机</span>

            </div>

            <div class="clear">

            </div>

            <div class="title">

                <span class="title_l">包装机械</span>

                <span class="title_r">更多</span>

            </div>

            <div class="clear">

            </div>

            <div class="table">

                <span>打包机</span>

                <span>真空包装机<em class="comment">HOT</em></span>

                <span>封装机</span>

                <span>缠绕机</span>

                <span>贴标机</span>

                <span>收缩机</span>

                <span>纸箱成型机</span>

                <span>套袋包装机</span>

                <span>装盒机</span>

                <span>装箱机</span>

            </div>

            <div class="clear">

            </div>

        </div>

    </body>

这个样子成吧?

如果搂住能看明白我就不解释了~

全明星演技分析
2015-05-30 · 人没有梦想和咸鱼有什么区别
全明星演技分析
采纳数:3046 获赞数:11774

向TA提问 私信TA
展开全部
<html>
<head>
<style type="text/css">
.machine {
font-size: 12px;
} .title {
height: 21px;
width: 420px;
margin: 1px 1px -1px 1px;
border-style: solid;
border-width: 1px;
border-color: #CFCFCF;
} .title_l {
padding: 2px;
float: left;
} .title_r {
padding: 2px;
float: right;
} .table {
width: 424px;
} .table span {
margin: 1px;
padding: 2px;
float: left;
display: block;
width: 100px;
text-align: center;
background-color: #CAE1FF;
} .clear {
clear: both;
} .comment {
font-size: 8px;
color: #8B7500;
}
</style>
</head>
<body>
<div class="machine">
<div class="title">
<span class="title_l">包装机械</span>
<span class="title_r">更多</span>
</div>
<div class="clear">
</div>
<div class="table">
<span>打包机<em class="comment">HOT</em></span>
<span>真空包装机</span>
<span>封装机</span>
<span>缠绕机</span>
<span>贴标机</span>
<span>收缩机</span>
<span>纸箱成型机</span>
<span>套袋包装机</span>
<span>装盒机</span>
<span>装箱机</span>
</div>
<div class="clear">
</div>
<div class="title">
<span class="title_l">包装机械</span>
<span class="title_r">更多</span>
</div>
<div class="clear">
</div>
<div class="table">
<span>打包机</span>
<span>真空包装机</span>
<span>封装机</span>
<span>缠绕机<em class="comment">HOT</em></span>
<span>贴标机</span>
<span>收缩机</span>
<span>纸箱成型机</span>
<span>套袋包装机<em class="comment">HOT</em></span>
<span>装盒机</span>
<span>装箱机</span>
</div>
<div class="clear">
</div>
<div class="title">
<span class="title_l">包装机械</span>
<span class="title_r">更多</span>
</div>
<div class="clear">
</div>
<div class="table">
<span>打包机</span>
<span>真空包装机<em class="comment">HOT</em></span>
<span>封装机</span>
<span>缠绕机</span>
<span>贴标机</span>
<span>收缩机</span>
<span>纸箱成型机</span>
<span>套袋包装机</span>
<span>装盒机</span>
<span>装箱机</span>
</div>
<div class="clear">
</div>
</div>
</body>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
烟客丶悲酒难觞
推荐于2017-09-20 · TA获得超过254个赞
知道小有建树答主
回答量:181
采纳率:100%
帮助的人:163万
展开全部
可以用div的相对定位来(position:relative;)解决。

具体解释:
1:先定义容器
在最外层先定义个div容器,设置为相对定义,定义好宽高,然后在此容易之中,在定义三个div,竖直排列,宽度和外层容易相同,高度为外层容器除去边框的高度除以3,此为二级容器
2:定义标题栏
在1步骤中定义好的三个二级容器中各定义一个div,宽度和二级容器一样,高度为二级容器的五分之一(这个高度根据具体的需要设置),然后在里面在定义两个div,左侧的用float:left定位在左侧,右侧的用float:right定位在右侧
3:定义具体内容div
有多少个格子,定义多少个div,每个div宽度为二级容器的四分之一,然后在每个div上都加上属性float:left,并且给每个div加上边框,行高,字体居中等属性即可
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
栾振华菅丑
2019-08-08 · TA获得超过3.8万个赞
知道小有建树答主
回答量:1.3万
采纳率:28%
帮助的人:996万
展开全部
<html>
<head>
<style
type="text/css">
.machine
{
font-size:
12px;
}
.title
{
height:
21px;
width:
420px;
margin:
1px
1px
-1px
1px;
border-style:
solid;
border-width:
1px;
border-color:
#CFCFCF;
}
.title_l
{
padding:
2px;
float:
left;
}
.title_r
{
padding:
2px;
float:
right;
}
.table
{
width:
424px;
}
.table
span
{
margin:
1px;
padding:
2px;
float:
left;
display:
block;
width:
100px;
text-align:
center;
background-color:
#CAE1FF;
}
.clear
{
clear:
both;
}
.comment
{
font-size:
8px;
color:
#8B7500;
}
</style>
</head>
<body>
<div
class="machine">
<div
class="title">
<span
class="title_l">包装机械</span>
<span
class="title_r">更多</span>
</div>
<div
class="clear">
</div>
<div
class="table">
<span>打包机<em
class="comment">HOT</em></span>
<span>真空包装机</span>
<span>封装机</span>
<span>缠绕机</span>
<span>贴标机</span>
<span>收缩机</span>
<span>纸箱成型机</span>
<span>套袋包装机</span>
<span>装盒机</span>
<span>装箱机</span>
</div>
<div
class="clear">
</div>
<div
class="title">
<span
class="title_l">包装机械</span>
<span
class="title_r">更多</span>
</div>
<div
class="clear">
</div>
<div
class="table">
<span>打包机</span>
<span>真空包装机</span>
<span>封装机</span>
<span>缠绕机<em
class="comment">HOT</em></span>
<span>贴标机</span>
<span>收缩机</span>
<span>纸箱成型机</span>
<span>套袋包装机<em
class="comment">HOT</em></span>
<span>装盒机</span>
<span>装箱机</span>
</div>
<div
class="clear">
</div>
<div
class="title">
<span
class="title_l">包装机械</span>
<span
class="title_r">更多</span>
</div>
<div
class="clear">
</div>
<div
class="table">
<span>打包机</span>
<span>真空包装机<em
class="comment">HOT</em></span>
<span>封装机</span>
<span>缠绕机</span>
<span>贴标机</span>
<span>收缩机</span>
<span>纸箱成型机</span>
<span>套袋包装机</span>
<span>装盒机</span>
<span>装箱机</span>
</div>
<div
class="clear">
</div>
</div>
</body>
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
收起 更多回答(2)
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式