最新文章专题视频专题问答1问答10问答100问答1000问答2000关键字专题1关键字专题50关键字专题500关键字专题1500TAG最新视频文章推荐1 推荐3 推荐5 推荐7 推荐9 推荐11 推荐13 推荐15 推荐17 推荐19 推荐21 推荐23 推荐25 推荐27 推荐29 推荐31 推荐33 推荐35 推荐37视频文章20视频文章30视频文章40视频文章50视频文章60 视频文章70视频文章80视频文章90视频文章100视频文章120视频文章140 视频2关键字专题关键字专题tag2tag3文章专题文章专题2文章索引1文章索引2文章索引3文章索引4文章索引5123456789101112131415文章专题3
当前位置: 首页 - 科技 - 知识百科 - 正文

纯CSS实现三列布局(两边固定,中间自适应)_html/css

来源:动视网 责编:小采 时间:2020-11-27 16:09:13
文档

纯CSS实现三列布局(两边固定,中间自适应)_html/css

纯CSS实现三列布局(两边固定,中间自适应)_html/css_WEB-ITnose:看了一些网上的案例,感觉较繁杂,于是,自己整理了一篇来说明这个东西。 也是给我自己复习吧,以前有人问道,我还没答上来呢。== 看代码: html: 1 this is top2 3 this is left4 this is center5 this is right6 7 this is
推荐度:
导读纯CSS实现三列布局(两边固定,中间自适应)_html/css_WEB-ITnose:看了一些网上的案例,感觉较繁杂,于是,自己整理了一篇来说明这个东西。 也是给我自己复习吧,以前有人问道,我还没答上来呢。== 看代码: html: 1 this is top2 3 this is left4 this is center5 this is right6 7 this is


看了一些网上的案例,感觉较繁杂,于是,自己整理了一篇来说明这个东西。

也是给我自己复习吧,以前有人问道,我还没答上来呢。==

看代码:

html:

1 this is top2 3 this is left4 this is center5 this is right6 7 this is footer

然后是CSS:

 1 .top{ 2 width: 100%; 3 height: 40px; 4 background-color: #cccccc; 5 } 6 .footer{ 7 width: 100%; 8 height: 50px; 9 background-color: #abdc44;10 }11 /*左右固定,中间自适应*/12 /*Start*/13 .container{14 width: 100%;15 height: 100%;16 position: relative;17 }18 .left{19 position: absolute;20 left: 0;21 top: 0;22 width: 400px;23 height: 800px;24 background-color: black;25 }26 .center{27 width: auto; /*如果没有这一句,那么,center这个div的文字就不会自动换行*/28 margin: 0 400px;29 height: 1000px;30 background-color: yellow;31 }32 .right{33 position: absolute;34 top: 0;35 right: 0;36 width: 400px;37 height: 900px;38 background-color: red;39 }40 /*End*/ 

最后是这个样子:

文档

纯CSS实现三列布局(两边固定,中间自适应)_html/css

纯CSS实现三列布局(两边固定,中间自适应)_html/css_WEB-ITnose:看了一些网上的案例,感觉较繁杂,于是,自己整理了一篇来说明这个东西。 也是给我自己复习吧,以前有人问道,我还没答上来呢。== 看代码: html: 1 this is top2 3 this is left4 this is center5 this is right6 7 this is
推荐度:
标签: 中间 固定 html
  • 热门焦点

最新推荐

猜你喜欢

热门推荐

专题
Top