CSS实例:三列等高布局
网站建设 2023-01-28 21:38www.1681989.com免费网站
三列等高CSS布局的一个实例,
修改国外的一个demo,
兼容到了IE5.5 和标准的浏览器OperaFirefoxSafari。
不过hack太多,不是很喜欢这样做。
全部代码如下
<?xmlversion="1.0"encodg="gb2312"?>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://.w3./1999/xhtml"lang="zh-CN">
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
<metahttp-equiv="Content-Language"content="zh-CN"/>
<metacontent="all"name="robots"/>
<title>3columnlauput</title>
<styletype="text/css"media="screen">
<!--
/<![CDATA[/
/-----------------------------------------------------------
@from:http://.alistapart./articles/holygrail
@modify:greengnn08-01-02
------------------------------------------------------------/
{
marg:0;
paddg:0;
}
body{
m-width:550px;
font:normalnormalnormal75%/1.25emVerdana,Arial,Helvetica,sans-serif;
color:#333333;
text-align:left;
}
/layout/
#contaer{
paddg-left:200px;
paddg-right:150px;
background:#000;
zoom:1;
}
#contaer:after{
content:'.';
display:block;
height:0;
clear:both;
visibility:hidden;
}
#contaer{display:le-block;}
/\/
#contaer{display:block;}
/\/
#center,#left,#right{
position:relative;
float:left;
}
html#center{
}
#center{width:100%;}
#left{
width:200px;
right:200px;
marg-left:-100%;
}
#right{
width:150px;
marg-right:-150px;
}
#footer{clear:both;}
/Equal-height/
#contaer{overflow:hidden;}
#footer{
overflow:hidden;
position:relative;
}
/IE7hack/
html#center{
position:static;
}
html#left{
position:static;
}
html#right{
position:static;
}
html#contaer{
position:relative;
overflow:hidden;
}
html#left{
position:relative;
}
/EndIE7hack/
/StartHackforOpera8/
/\/
#contaer#center,#contaer#left,#contaer#right{
paddg-bottom:32767px!important;
marg-bottom:-32767px!important;
}
@mediaalland(m-width:0px){
#contaer#center,#contaer#left,#contaer#right{
paddg-bottom:0!important;
marg-bottom:0!important;
}
#center:before,#left:before,#right:before{
content:'[DONOTLEAVEITISNOTREAL]';
display:block;
background:herit;
paddg-:32767px!important;
marg-bottom:-32767px!important;
height:0;
}
}
//
/EndHackforOpera8/
/justtosee/
#header,#footer{
font-size:40px;
le-height:40px;
text-align:center;
font-weight:bold;
color:#;
background:#666666;
}
#center{background:#eeeeee;}
#left{background:#FF9933;}
#right{background:#0099CC;}
/]]>/
-->
</style>
</head>
<body>
<divid="header">header(testIE5.5 opera9.0Firefox2.0)</div>
<divid="contaer">
<divid="center">
<h2>Abstract</h2>
<p>Thewebisconstantlyevolvg.Newandnovativewebsitesarebegcreatedeveryday,pushgtheboundariesofHTMLeverydirection.HTML4hasbeenaroundfornearlyadecadenow,andpublishersseekgnewtechniquesrovideenhancedfunctionalityarebegheldbackbytheconstratsofthelanguageandbrowsers.</p>
<p>Togiveauthorsmoreflexibilityandteroperability,andenablemoreteractiveandexcitgwebsitesandapplications,HTML5troducesandenhancesawiderangeoffeaturescludgformcontrols,APIs,multimedia,structure,andsemantics.</p>
<p>WorkonHTML5,whichmenced2004,iscurrentlybegcarriedoutajoteffortbetweenthe<ahref="http://.w3./html/"><abbrtitle="W3CHTMLWorkgGroup">W3CHTMLWG</abbr></a>andthe<ahref="http://.whatwg./"><abbrtitle="WebHypertextApplicationTechnologyWorkgGroup">WHATWG</abbr></a>.ManykeyplayersareparticipatgtheW3Ceffortcludgrepresentativesfromthefourmajorbrowservendors:Apple,Mozilla,Opera,andMicrosoft;andarangeofotheranisationsanddividualswithmanydiverseterestsandexpertise.</p>
<p>Notethat<ahref="http://.w3./html/wg/html5/">thespecification</a>isstilla<em>workprogress</em>andquitealongwayfrompletion.Assuch,itispossiblethatanyfeaturediscussedthisarticlemaychangethefuture.Thisarticleistendedrovideabrieftroductiontosomeofthemajorfeaturesastheyarethecurrentdraft.</p>
</div>
<divid="left">
<h2>Abstract</h2>
<p>Thewebisconstantlyevolvg.Newandnovativewebsitesarebegcreatedeveryday,pushgtheboundariesofHTMLeverydirection.HTML4hasbeenaroundfornearlyadecadenow,andpublishersseekgnewtechniquesrovideenhancedfunctionalityarebegheldbackbytheconstratsofthelanguageandbrowsers.</p>
<p>Togiveauthorsmoreflexibilityandteroperability,andenablemoreteractiveandexcitgwebsitesandapplications,HTML5troducesandenhancesawiderangeoffeaturescludgformcontrols,APIs,multimedia,structure,andsemantics.</p>
<p>WorkonHTML5,whichmenced2004,iscurrentlybegcarriedoutajoteffortbetweenthe<ahref="http://.w3./html/"><abbrtitle="W3CHTMLWorkgGroup">W3CHTMLWG</abbr></a>andthe<ahref="http://.whatwg./"><abbrtitle="WebHypertextApplicationTechnologyWorkgGroup">WHATWG</abbr></a>.ManykeyplayersareparticipatgtheW3Ceffortcludgrepresentativesfromthefourmajorbrowservendors:Apple,Mozilla,Opera,andMicrosoft;andarangeofotheranisationsanddividualswithmanydiverseterestsandexpertise.</p>
<p>Notethat<ahref="http://.w3./html/wg/html5/">thespecification</a>isstilla<em>workprogress</em>andquitealongwayfrompletion.Assuch,itispossiblethatanyfeaturediscussedthisarticlemaychangethefuture.Thisarticleistendedrovideabrieftroductiontosomeofthemajorfeaturesastheyarethecurrentdraft.</p>
</div>
<divid="right">
<h2>Abstract</h2>
<p>Thewebisconstantlyevolvg.Newandnovativewebsitesarebegcreatedeveryday,pushgtheboundariesofHTMLeverydirection.HTML4hasbeenaroundfornearlyadecadenow,andpublishersseekgnewtechniquesrovideenhancedfunctionalityarebegheldbackbytheconstratsofthelanguageandbrowsers.</p>
<p>Togiveauthorsmoreflexibilityandteroperability,andenablemoreteractiveandexcitgwebsitesandapplications,HTML5troducesandenhancesawiderangeoffeaturescludgformcontrols,APIs,multimedia,structure,andsemantics.</p>
<p>WorkonHTML5,whichmenced2004,iscurrentlybegcarriedoutajoteffortbetweenthe<ahref="http://.w3./html/"><abbrtitle="W3CHTMLWorkgGroup">W3CHTMLWG</abbr></a>andthe<ahref="http://.whatwg./"><abbrtitle="WebHypertextApplicationTechnologyWorkgGroup">WHATWG</abbr></a>.ManykeyplayersareparticipatgtheW3Ceffortcludgrepresentativesfromthefourmajorbrowservendors:Apple,Mozilla,Opera,andMicrosoft;andarangeofotheranisationsanddividualswithmanydiverseterestsandexpertise.</p>
<p>Notethat<ahref="http://.w3./html/wg/html5/">thespecification</a>isstilla<em>workprogress</em>andquitealongwayfrompletion.Assuch,itispossiblethatanyfeaturediscussedthisarticlemaychangethefuture.Thisarticleistendedrovideabrieftroductiontosomeofthemajorfeaturesastheyarethecurrentdraft.</p>
</div>
</div>
<divid="footer">footer</div>
<scriptsrc="http://.google-analytics./urch.js"type="text/javascript"></script>
<scripttype="text/javascript">
/<![CDATA[/
_uat="UA-496414-1";
/]]>/
</script>
</body>
</html>
查看运行效果
修改国外的一个demo,
兼容到了IE5.5 和标准的浏览器OperaFirefoxSafari。
不过hack太多,不是很喜欢这样做。
全部代码如下
<?xmlversion="1.0"encodg="gb2312"?>
<!DOCTYPEhtmlPUBLIC"-//W3C//DTDXHTML1.0Transitional//EN""http://.w3./TR/xhtml1/DTD/xhtml1-transitional.dtd">
<htmlxmlns="http://.w3./1999/xhtml"lang="zh-CN">
<head>
<metahttp-equiv="Content-Type"content="text/html;charset=gb2312"/>
<metahttp-equiv="Content-Language"content="zh-CN"/>
<metacontent="all"name="robots"/>
<title>3columnlauput</title>
<styletype="text/css"media="screen">
<!--
/<![CDATA[/
/-----------------------------------------------------------
@from:http://.alistapart./articles/holygrail
@modify:greengnn08-01-02
------------------------------------------------------------/
{
marg:0;
paddg:0;
}
body{
m-width:550px;
font:normalnormalnormal75%/1.25emVerdana,Arial,Helvetica,sans-serif;
color:#333333;
text-align:left;
}
/layout/
#contaer{
paddg-left:200px;
paddg-right:150px;
background:#000;
zoom:1;
}
#contaer:after{
content:'.';
display:block;
height:0;
clear:both;
visibility:hidden;
}
#contaer{display:le-block;}
/\/
#contaer{display:block;}
/\/
#center,#left,#right{
position:relative;
float:left;
}
html#center{
}
#center{width:100%;}
#left{
width:200px;
right:200px;
marg-left:-100%;
}
#right{
width:150px;
marg-right:-150px;
}
#footer{clear:both;}
/Equal-height/
#contaer{overflow:hidden;}
#footer{
overflow:hidden;
position:relative;
}
/IE7hack/
html#center{
position:static;
}
html#left{
position:static;
}
html#right{
position:static;
}
html#contaer{
position:relative;
overflow:hidden;
}
html#left{
position:relative;
}
/EndIE7hack/
/StartHackforOpera8/
/\/
#contaer#center,#contaer#left,#contaer#right{
paddg-bottom:32767px!important;
marg-bottom:-32767px!important;
}
@mediaalland(m-width:0px){
#contaer#center,#contaer#left,#contaer#right{
paddg-bottom:0!important;
marg-bottom:0!important;
}
#center:before,#left:before,#right:before{
content:'[DONOTLEAVEITISNOTREAL]';
display:block;
background:herit;
paddg-:32767px!important;
marg-bottom:-32767px!important;
height:0;
}
}
//
/EndHackforOpera8/
/justtosee/
#header,#footer{
font-size:40px;
le-height:40px;
text-align:center;
font-weight:bold;
color:#;
background:#666666;
}
#center{background:#eeeeee;}
#left{background:#FF9933;}
#right{background:#0099CC;}
/]]>/
-->
</style>
</head>
<body>
<divid="header">header(testIE5.5 opera9.0Firefox2.0)</div>
<divid="contaer">
<divid="center">
<h2>Abstract</h2>
<p>Thewebisconstantlyevolvg.Newandnovativewebsitesarebegcreatedeveryday,pushgtheboundariesofHTMLeverydirection.HTML4hasbeenaroundfornearlyadecadenow,andpublishersseekgnewtechniquesrovideenhancedfunctionalityarebegheldbackbytheconstratsofthelanguageandbrowsers.</p>
<p>Togiveauthorsmoreflexibilityandteroperability,andenablemoreteractiveandexcitgwebsitesandapplications,HTML5troducesandenhancesawiderangeoffeaturescludgformcontrols,APIs,multimedia,structure,andsemantics.</p>
<p>WorkonHTML5,whichmenced2004,iscurrentlybegcarriedoutajoteffortbetweenthe<ahref="http://.w3./html/"><abbrtitle="W3CHTMLWorkgGroup">W3CHTMLWG</abbr></a>andthe<ahref="http://.whatwg./"><abbrtitle="WebHypertextApplicationTechnologyWorkgGroup">WHATWG</abbr></a>.ManykeyplayersareparticipatgtheW3Ceffortcludgrepresentativesfromthefourmajorbrowservendors:Apple,Mozilla,Opera,andMicrosoft;andarangeofotheranisationsanddividualswithmanydiverseterestsandexpertise.</p>
<p>Notethat<ahref="http://.w3./html/wg/html5/">thespecification</a>isstilla<em>workprogress</em>andquitealongwayfrompletion.Assuch,itispossiblethatanyfeaturediscussedthisarticlemaychangethefuture.Thisarticleistendedrovideabrieftroductiontosomeofthemajorfeaturesastheyarethecurrentdraft.</p>
</div>
<divid="left">
<h2>Abstract</h2>
<p>Thewebisconstantlyevolvg.Newandnovativewebsitesarebegcreatedeveryday,pushgtheboundariesofHTMLeverydirection.HTML4hasbeenaroundfornearlyadecadenow,andpublishersseekgnewtechniquesrovideenhancedfunctionalityarebegheldbackbytheconstratsofthelanguageandbrowsers.</p>
<p>Togiveauthorsmoreflexibilityandteroperability,andenablemoreteractiveandexcitgwebsitesandapplications,HTML5troducesandenhancesawiderangeoffeaturescludgformcontrols,APIs,multimedia,structure,andsemantics.</p>
<p>WorkonHTML5,whichmenced2004,iscurrentlybegcarriedoutajoteffortbetweenthe<ahref="http://.w3./html/"><abbrtitle="W3CHTMLWorkgGroup">W3CHTMLWG</abbr></a>andthe<ahref="http://.whatwg./"><abbrtitle="WebHypertextApplicationTechnologyWorkgGroup">WHATWG</abbr></a>.ManykeyplayersareparticipatgtheW3Ceffortcludgrepresentativesfromthefourmajorbrowservendors:Apple,Mozilla,Opera,andMicrosoft;andarangeofotheranisationsanddividualswithmanydiverseterestsandexpertise.</p>
<p>Notethat<ahref="http://.w3./html/wg/html5/">thespecification</a>isstilla<em>workprogress</em>andquitealongwayfrompletion.Assuch,itispossiblethatanyfeaturediscussedthisarticlemaychangethefuture.Thisarticleistendedrovideabrieftroductiontosomeofthemajorfeaturesastheyarethecurrentdraft.</p>
</div>
<divid="right">
<h2>Abstract</h2>
<p>Thewebisconstantlyevolvg.Newandnovativewebsitesarebegcreatedeveryday,pushgtheboundariesofHTMLeverydirection.HTML4hasbeenaroundfornearlyadecadenow,andpublishersseekgnewtechniquesrovideenhancedfunctionalityarebegheldbackbytheconstratsofthelanguageandbrowsers.</p>
<p>Togiveauthorsmoreflexibilityandteroperability,andenablemoreteractiveandexcitgwebsitesandapplications,HTML5troducesandenhancesawiderangeoffeaturescludgformcontrols,APIs,multimedia,structure,andsemantics.</p>
<p>WorkonHTML5,whichmenced2004,iscurrentlybegcarriedoutajoteffortbetweenthe<ahref="http://.w3./html/"><abbrtitle="W3CHTMLWorkgGroup">W3CHTMLWG</abbr></a>andthe<ahref="http://.whatwg./"><abbrtitle="WebHypertextApplicationTechnologyWorkgGroup">WHATWG</abbr></a>.ManykeyplayersareparticipatgtheW3Ceffortcludgrepresentativesfromthefourmajorbrowservendors:Apple,Mozilla,Opera,andMicrosoft;andarangeofotheranisationsanddividualswithmanydiverseterestsandexpertise.</p>
<p>Notethat<ahref="http://.w3./html/wg/html5/">thespecification</a>isstilla<em>workprogress</em>andquitealongwayfrompletion.Assuch,itispossiblethatanyfeaturediscussedthisarticlemaychangethefuture.Thisarticleistendedrovideabrieftroductiontosomeofthemajorfeaturesastheyarethecurrentdraft.</p>
</div>
</div>
<divid="footer">footer</div>
<scriptsrc="http://.google-analytics./urch.js"type="text/javascript"></script>
<scripttype="text/javascript">
/<![CDATA[/
_uat="UA-496414-1";
/]]>/
</script>
</body>
</html>
查看运行效果
上一篇:CSS高级技巧:圆角矩形
下一篇:Web标准前途是否依赖浏览器技术
网站设计
- 静宁会SEO的网站建设公司:全面提升您的网络影
- 提升在线业务的关键:选择最佳的丽水网站建设
- 浙江网站优化发展潜力如何
- 井研专业的网站建设公司:打造您的在线品牌
- 灵山SEO网站建设公司:提升您的在线业务表现
- 蒙城网站建设优化公司:提升您网站表现的理想
- 阳谷企业网站优化:提升线上业务力的关键
- 樟树专业的网站建设公司:打造您在线业务的坚
- 通河百度SEO排名的策略与技巧
- 重庆百度快照排名如何进行精准的客户引流
- 重庆百度快照排名
- 常宁便宜的建站公司:助您轻松打造在线业务
- 巫溪百度网站优化:提升网站曝光率与流量的关
- 湖北整站优化怎么做才能放大客户需求
- 闸北网站建设多少钱?全面解析与预算规划
- 辽宁企业网站优化怎么做电话营销