zoukankan
html css js c++ java
css外容器margin問題[IE中height:100%]
常用的二列布局,外容器Div定義class為container, 包含class分別為left 和main兩個子DIV,下邊是class為foot的Div
當我們想在container和foot之間加一點間隙時,fifefox卻發起了脾氣
代碼如下:
<!
DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"
>
<
html
xmlns
="http://www.w3.org/1999/xhtml"
>
<
head
>
<
meta
http-equiv
="Content-Type"
content
="text/html; charset=utf-8"
/>
<
title
>
測試頁
</
title
>
<
style
type
="text/css"
>
.container
{
}
{
border
:
1px #333 solid
;
width
:
600px
;
margin-bottom
:
20px
;
}
.container .left
{
}
{
width
:
300px
;
float
:
left
;
height
:
100px
;
background
:
#f60
;
}
.container .right
{
}
{
width
:
300px
;
float
:
left
;
height
:
300px
;
background
:
#ccc
;
}
.foot
{
}
{
clear
:
both
;
width
:
600px
;
height
:
20px
;
background
:
#3D78B6
;
border
:
1px solid #000000
;
}
</
style
>
</
head
>
<
body
>
<
div
class
="container"
>
<
div
class
="left"
></
div
>
<
div
class
="right"
></
div
>
</
div
>
<
div
class
="foot"
></
div
>
</
body
>
</
html
>
以上代碼在IE6中能正常顯示,但是在firefox中container和footer之間沒有間隙,也就是說margin-bottom:20沒起作用
解決變法:
修改container,代碼如下:
.container
{
}
{
overflow
:
hidden
;
border
:
1px #333 solid
;
width
:
600px
;
margin-bottom
:
20px
;
}
區別就在這一句
查看全文
相关阅读:
tomcat的OutOfMemoryError内存溢出解决方法
转:动态table分页(ORCALE)
转: 根据屏幕分辨率,浏览器调用不同css
转:只能选择GridView中的一个CheckBox(单选CheckBox)
转:tomcat安全设置
Tomcat内存设置详解
Dos命令删除添加新服务
卸载oracle 10g
转:oracle:win7手工卸载oracle数据库11g
win7 下安装oracle 10 g
原文地址:https://www.cnblogs.com/ywkpl/p/1224555.html
最新文章
Java.HttpClient绕过Https证书解决方案一
Eclipse 自动补全代码返回值快捷键
HDFS(分布式存储)_Hadoop核心_002-----------通过javaAPI的方式操作HDFS
HDFS(分布式存储)_Hadoop核心_001
Hadoop笔记
第二集:Hodoop介绍及集群搭建
第一集:大数据常用Linux命令总结+环境集群搭建+zookeeper概述
Hadoop入门及环境集群搭建
JavaScript_BOM
JavaScript_DOM
热门文章
Javascript对象
jQuery中bind与live的用法与区别
jQuery中delegate与on的用法与区别
优秀程序员的6个共同特质
JS获取ckeditor4.x里的值
CKEditor实现图片上传
CKEditor4.x部署和配置
java实现验证码
JS自动刷新页面一次
Class org.apache.struts2.json.JSONWriter can not access a member of class oracle.jdbc.driver.Physica
Copyright © 2011-2022 走看看