请各位高手赶紧帮我看下这div+css布局吧

[复制链接]
查看11 | 回复5 | 2008-7-21 21:31:35 | 显示全部楼层 |阅读模式
body{
margin-left: 15px;
margin-top: 0px;
margin-right: 15px;
margin-bottom: 0px;
}
div{
width:970px;
height:1465px;
border: 0px solid #FF0000;
color: #FF7300;
}
div#a{
width:970px;
height:70px;
border: 1px solid #FF0000;
padding: 0px;
margin-left: 0px;
margin-top: 0px;
margin-right: 0px;
margin-bottom: 0px;
}
div#b{
width:970px;
height:70px;
border: 1px solid #FF0000;
padding: 0px;
margin-left: 0px;
margin-top: 6px;
margin-right: 0px;
margin-bottom: 0px;
}
div#c{
width:970px;
height:35px;
border: 1px solid #FF0000;
padding: 0px;
margin-left: 0px;
margin-top: 6px;
margin-right: 0px;
margin-bottom: 0px;
}
div#dd{
width:970px;
height:190px;
border: 1px solid #FF0000;
padding: 0px;
margin-left: 0px;
margin-top: 6px;
margin-right: 0px;
margin-bottom: 0px;
}
div#d{
width:758px;
height:80px;
border: 1px solid #FF0000;
padding: 0px;
margin-left: 0px;
margin-top: 6px;
margin-right: 0px;
margin-bottom: 0px;
}
div#e{
width:204px;
height:260px;
border: 1px solid #FF0000;
padding: 0px;
margin-left: 766px;
margin-top: -82px;
margin-right: 0px;
margin-bottom: 0px;
}
div#f{
width:204px;
height:260px;
border: 1px solid #FF0000;
padding: 0px;
margin-left: 766px;
margin-top: 6px;
margin-right: 0px;
margin-bottom: 0px;
}
div#g{
width:204px;
height:260px;
border: 1px solid #FF0000;
padding: 0px;
margin-left: 766px;
margin-top: 6px;
margin-right: 0px;
margin-bottom: 0px;
}
div#h{
width:204px;
height:260px;
border: 1px solid #FF0000;
padding: 0px;
margin-left: 766px;
margin-top: 6px;
margin-right: 0px;
margin-bottom: 0px;
}
div#i{
width:758px;
height:876px;
border: 1px solid #FF0000;
padding: 0px;
margin-left: 0px;
margin-top: -978px;
margin-right: 0px;
margin-bottom: 0px;
}
div#j{
width:758px;
height:92px;
border: 1px solid #FF0000;
padding: 0px;
margin-left: 0px;
margin-top: 6px;
margin-right: 0px;
margin-bottom: 0px;
}

















我想知道这是不是正确,合理,标准的div+css布局呢,会不会出现一些难一想象的异常现象呢?因为我都是用DW学表格布的,在网上看到很多人说因该用div+css布局,所以自己琢磨布出了这么个局面,我有点不赶相信自己能在没系统的学习div+css的情况下这么轻易的就把它布出来了;如果是错误的布法能否指教下div+css布局中的要点要素及常用属性,布局中都该注意些什么?谢谢!
我将e-h插入图片后,再向d i j填充内容,发现无法填充,所填的内容都跑到e-h去了,我这写法要是错误的,恳请哪位大吓帮我更正下写出正确合理的吧

回复

使用道具 举报

千问 | 2008-7-21 21:31:35 | 显示全部楼层
分,我拿了首先,我大致看了一下你的CSS代码,看来的确是初学。有很多是可以缩写的,这点你应当学习一下,例如:margin-left: 766px; margin-top: -82px; margin-right: 0px; margin-bottom: 0px; 是可以缩写成:margin:-82px 0 0 766px;的就着这个例子,也能看出,你的margin-left:766明显是错误的,不是因为我没做过或者不相信什么的,只是如果你布局正确,不可能用到这么大的数值。然后你HTML中的div大部分里面都写了id,不是说不正确,只是页面中尽量少用ID,因为JS大部分是根据ID调用运行的,你可以用class代
回复

使用道具 举报

千问 | 2008-7-21 21:31:35 | 显示全部楼层
恭喜你,通过IE6 7 及FF测试做的不错.唯一就是在宽屏显示器下不是居中的,以后在做网页时可以留意一下细节方面的问题^_^
回复

使用道具 举报

千问 | 2008-7-21 21:31:35 | 显示全部楼层
你的问题很多,首先,太复杂了,比如说:边界可以简写,margin:10px;/*上下左右都是10px*/
margin:10px 20px 30px;/*上是10px,左右都是20px,下是30px。
margin:10px 20px 30px 40px;/*上下左右依次是那四个数.*/第二
回复

使用道具 举报

千问 | 2008-7-21 21:31:35 | 显示全部楼层
学习值得鼓励 加油 问题 好像不少 呵呵 #a{}就可以了 不用加div ;很多margin 和padding这类的是0px的都可以 dele。 不晓得这个你干吗用 练手的话就多改改 呵呵 找几本书看看 你会写出很好的css的
回复

使用道具 举报

千问 | 2008-7-21 21:31:35 | 显示全部楼层
朋友,你这个布局太死板了,用到实际的网站制作是行不通的.你这样是把所有网站板块的高度都订死了,如果某个板块要高一点或者低一点,调整就很麻烦,还有尽量少用ID.还有楼上所有的样式简写问题朋友,建议你多学习.以后一定能成为高手的
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行