css - HTML5/CSS3 中类似 WPF 的布局

标签 css html

我怎样才能达到:

<Grid>
 <Grid.RowDefinitions>
  <RowDefinition Height="300">
  <RowDefinition Height="*">
  <RowDefinition Height="100">

高度为 * 的行在顶行和底行占用 400px 后是否填充剩余的屏幕空间?

谢谢

最佳答案

您可以通过使用 div(s) 来实现这一点

<div class="upperSection">

</div>

<div class="content">

</div>


<div class="lowerSection">

</div>

和CSS:

.upperSection
{
    position:absolute;
    top:0;
    left:0;
    height:300px;
    width:100%;
}

.content
{
  position:absolute;
  top:300px;
  left:0;
  height:100%;
  width:100%;
}

.lowerSection
{
  position:absolute;
 bottom:0;
 left:0;
 height:100px;
 width:100%;

}

关于css - HTML5/CSS3 中类似 WPF 的布局,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3284261/

相关文章:

css - 当窗口以 window.open 打开时,DIV 中的内容被重叠

html - HTML/CSS 中类似 Windows 的用户界面?

html - Windows Phone 7.5 HTML 电子邮件中的不同字体大小

javascript - 将一个文本框的内容复制到另一个

javascript - jQuery Dim 或在悬停时更改其他列表项

html - CSS 过滤器 : Wikipedia: Inline math's background is not transparent

html - 获取表单输入以扩展到具有可变大小标签的容器的全宽

html - img 之间的垂直间距

css - Bootstrap 列定价表 UI 问题

html - 调整插入内容 :url() 的 svg 图像