Comments (3)
我觉得这个例子举的不好。
正常的主视区域(main),一般都不会定高吧,我觉得应该是会随着内部元素的变动而高度发生变化的。
所以这类布局我还是喜欢稍微配合一点js实现吧…
from you-need-to-know-css.
@zjhch123
我觉得这个例子举的不好。
正常的主视区域(main),一般都不会定高吧,我觉得应该是会随着内部元素的变动而高度发生变化的。
所以这类布局我还是喜欢稍微配合一点js实现吧…
你可能理解错了,你应该将section
当做主视区域,而不是main
,后者的定高只是为了示例在文档中的显示效果~
from you-need-to-know-css.
我有个方案,兼容性可以到ie6,我们线上项目都在用
<div class="body_box">
<div class="main">main</div>
</div>
<div class="footer">footer</div>
.body_box {
position: relative;
min-height: 100%;
width: 100%;
overflow: hidden;
}
.footer {
position: relative;
margin-top: -31px;
width: 100%;
text-align: center;
height: 30px;
border-top: 1px solid #e5e5e5;
color: #666;
z-index: 10;
overflow: hidden;
}
可以点开这个链接地址看
demo
from you-need-to-know-css.
Related Issues (20)
- 提示气泡 HOT 1
- 圣杯布局 HOT 4
- 双飞翼布局 HOT 2
- 类订单布局 HOT 1
- 1px 线/边 HOT 2
- 插入换行
- 弹跳效果 HOT 1
- Flex布局 HOT 4
- Im so happy to read it HOT 1
- progress 中 的动画 panoramic 是不是忘了加上去? HOT 2
- 自定义变量
- 有趣的项目 HOT 4
- 文本截断 HOT 2
- 常用代码片段
- 自定义开关按钮Switch HOT 2
- On hover fade image and show text
- 是star,不是start
- 大量图片拼写文字效果
- 官网挂了 HOT 1
- flex小节错误 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from you-need-to-know-css.