指穷于为薪,火传也,不知其尽也。—《养生主》

Daily English:He is a wise man who speaks little.

三行两列布局能否最小高度为100%?

以前发在缔吧论坛的帖子,没最终解决,先抄过来吧:

现在这个网站的基本布局如下:

Language:  HTML
<div id="header">...</div>
<div id="container">
  <div id="mainbg">
    <div id="left">...</div>
    <div id="right">...</div>
  </div>
</div>
<div id="footer">...</div>

我现在希望当中间的left和right内容不是很多的时候, 他们的高度=浏览器高度-header的高度-footer的高度 ,也就是使得整个页面最小高度也是能够撑满的,用js是能够做到,但我不希望通过js实现。。。似乎css能够做到,不知道使用min-height是否,于是在缔吧发帖询问。

forestgan提出了一个很有意思的写法,前提是头尾都是使用百分比的:

Language:  HTML
< !DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
 
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title></title>
	<style type="text/css">
	body,html{height: 100%;padding: 0;margin: 0;}
	#header,#footer{height: 10%;background: #EBF7F9;}
 
	#container{min-height: 80%;background: #FDF5E6;	}
	/*\\*/
	* html #container{
		height: 80%;
	}
	/**/
	</style>
</head>
 
<body>
<div id="header">...</div>
<div id="container">
  <div id="mainbg">
    <div id="left">...</div>
    <div id="right">...Cellular Technologies 
Cell line development 
Engineered cell-based assays 
Cell based assays are an essential tool in understanding biological pathways especially when linked to high throughput readouts. Native cell lines or cells engineered to express foreign reporter genes can be used to read out a biological target or pathway or to confirm the activity and mechanism of action of drug candidates. Dragonfly has extensive experience in establishing known cell-based assays or developing new ones.
 
Examples of engineered cells and assays which Dragonfly has experience in include:
 
Heterologous or chimeric receptor growth factor assays. Growth factor dependent cells can convenient cellular bioassays for growth factors or cytokines. Dragonfly has engineered heterologous human or rodent receptors into factor dependent cells as stable transformants to provide a readouts for ligand induced receptor activation or to assay small molecule or antibody antagonists. We have also engineered chimeric receptors with novel extracellular domains linked to a signaling intracellular domain to derive ligand dependent cell lines. 
Engineered reporter cell assays. Reporter genes may be used to monitor promoter activity, the expression of tagged proteins, or to read out a biological pathway. Dragonfly has experience with multiple cell types engineered to express a variety of epitope tagged proteins or reporter proteins adapted to high throughput, 96 well assays. Examples of epitope tags or reporters we have worked with include: FLAG, His6, myc, GFP and lac Z. 
</div>
  </div>
</div>
<div id="footer">...</div>
</body>
</html>

郁闷的是……我的就是固定高度的……只能立此存照了……不过好心的forestgan同学还是给我找了个链接,虽然看不怎么懂,不过看效果,似乎就是我需要的了。先留着,等我看得懂css的时候再来研究

分享家:Addthis中国

Leave a comment for: "三行两列布局能否最小高度为100%?"

*

Tag Cloud