You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>Document</title>
<style>
* {
padding: 0;
margin: 0;
}
body, html {
height: 100%;
}
#wraper {
min-height: 100%;
background-color: pink;
text-align: center;
overflow: hidden;
}
#wraper .main {
padding-bottom: 50px;
}
#footer {
height: 50px;
background-color: greenyellow;
text-align: center;
margin-top: -50px;
}
</style>
</head>
<body>
<div id="wraper">
<div class="main">
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Tempora tempore, id placeat cupiditate doloribus temporibus consectetur mollitia magnam ipsa quae ut nisi, eos voluptates repudiandae, eius sint nobis. Molestiae, ipsa!
Lorem ipsum dolor sit amet consectetur adipisicing elit. Voluptas asperiores facilis corrupti iure. Praesentium ab, eius dolorem quibusdam ex adipisci optio reprehenderit beatae, natus consequatur, nam in incidunt aliquam architecto?
Lorem ipsum dolor sit amet consectetur adipisicing elit. Qui, eligendi. Nulla, in! Dignissimos culpa aliquid eaque cumque ea doloribus quaerat recusandae iure, vero maxime nobis harum deserunt architecto? Aliquam, ipsa?
Lorem, ipsum dolor sit amet consectetur adipisicing elit. Quia enim explicabo optio eveniet inventore eos laudantium quas, at quo recusandae! Perferendis tempora, porro ipsa corporis laboriosam accusantium placeat ad itaque.
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Alias ipsum et numquam praesentium rerum beatae repellat, exercitationem veniam in. Ducimus molestiae cumque fugiat repudiandae possimus natus quos laudantium pariatur minus?
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Magnam reiciendis iste nulla porro quidem ducimus illum blanditiis aspernatur, officiis minima error, tenetur id reprehenderit ad possimus voluptate odio veritatis ipsam.
Lorem ipsum dolor sit amet consectetur, adipisicing elit. Ut veritatis aperiam dolores, ipsam suscipit molestias eaque doloribus voluptates modi, labore sapiente vel dolorem iure esse doloremque error voluptatum itaque praesentium.
Lorem ipsum, dolor sit amet consectetur adipisicing elit. Quidem officiis ipsam non odio pariatur libero necessitatibus aut fugiat inventore, beatae dolore mollitia porro saepe nesciunt incidunt earum voluptatibus et adipisci.
</div>
</div>
<div id="footer"></div>
</body>
</html>
一、常见的布局
圣杯布局+双飞翼布局
1、 圣杯布局
2、 双飞翼布局
3、 圣杯布局flex版
关于flex的使用这里贴一下阮一峰大佬的博客:Flex 布局教程:语法篇
4、粘连布局
布局要求:
有一块内容
<main>
,当<main>
的高康足够长的时候,紧跟在<main>
后面的元素<footer>
会跟在<main>
元素的后面。当
<main>
元素比较短的时候(比如小于屏幕的高度),我们期望这个<footer>
元素能够“粘连”在屏幕的底部5、两列自适应布局
两列自适应布局是指一列由内容撑开,另一列撑满剩余宽度的布局方式
参考资料
几种常见的 CSS 布局
圣杯布局和双飞翼布局的理解和区别,并用代码实现
二、页面导入样式时,使用link和@import有什么区别?
三、html的元素有哪些(包含H5)?
四、CSS3有哪些新增的特性?
五、HTML全局属性(global attribute)有哪些(包含H5)?
六、在页面上隐藏元素的方法有哪些?
The text was updated successfully, but these errors were encountered: