美文网首页
三列布局的问题

三列布局的问题

作者: Marks | 来源:发表于2017-05-26 15:45 被阅读19次
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>test</title>
    <style type="text/css">
       body{margin: 0;padding:0;}
       header{position: fixed;top:0; height: 100px;width: 100%;background-color: #ddd;overflow: auto;}
       main{position: absolute;top:100px;bottom:100px;overflow: auto; }
       .content{height: 1000px;}
       footer{position: fixed;bottom: 0;height: 100px;width: 100%;background-color: #ddd;}
    </style>
</head>
<body>
    <header>Header</header>
    <main><div class="content"> Main content</div></main>
    <footer>Footer</footer>
</body>
</html>```
Q1:上面代码会导致这个奇怪的问题,什么情况??

![](https://img.haomeiwen.com/i316258/5c004d5191f699ba.png?imageMogr2/auto-orient/strip%7CimageView2/2/w/1240)


<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<title>test</title>
<style type="text/css">
body{margin: 0;padding:0;}
header{position: fixed;top:0; height: 100px;width: 100%;background-color: #ddd;overflow: auto;}
main{position: absolute;top:100px;bottom:100px;overflow: auto;height: 1000px;}
footer{position: fixed;bottom: 0;height: 100px;width: 100%;background-color: #ddd;}
</style>
</head>
<body>
<header>Header</header>
<main>Main content</main>
<footer>Footer</footer>
</body>
</html>```
Q2:上面代码使main的滚轮贯穿header和footer,如何使其只在main中出现滚轮??

相关文章

  • 思维导图百图计划

    今天导图的布局有点问题,明天改正布局方面的问题。

  • 布局问题

    1、外边距重叠——若两个元素上下毗邻且都定义了不为0的外边距值,同时又没有任何内边距、边框等设定,那么这两个元素之...

  • 表情、输入布局辅助View

    解决聊天布局 输入框、键盘弹起、表情布局、其他布局的交互布局变化问题

  • 页面布局

    概述: 页面布局常用的方法有浮动布局、绝对定位布局、表格布局、弹性布局(flex)、网格布局 三栏布局问题高度已知...

  • 屏幕适配经验(二)

    屏幕适配问题的本质: 使得“布局”、“布局组件”、“图片资源”、“用户界面流程”匹配不同的屏幕尺寸 使得布局、布局...

  • 布局浮动的问题

    浮动的问题 什么是浮动?浮动(float)的副作用清除浮动两种清除浮动的办法如下:

  • Unable to inject views for ViewH

    检查布局问题

  • css-grid布局

    css布局是前端页面无法避免的一个问题,经典的圣杯布局,水平/垂直居中问题等,我们以前用到的tabel布局,浮动布...

  • iOS页面布局:UIScrollView的布局问题

    一、简述 在iOS11以后的系统中UIViewController的automaticallyAdjustsScr...

  • CSS 经典三列布局之圣杯布局

    圣杯布局 圣杯布局是典型的 CSS 布局问题,有着众多的解决方案。 圣杯布局是一种非常经典和常用的布局方式,其所指...

网友评论

      本文标题:三列布局的问题

      本文链接:https://www.haomeiwen.com/subject/fbawxxtx.html