当前位置: 首页 > news >正文

专做品牌网站谷歌seo和百度seo

专做品牌网站,谷歌seo和百度seo,js网站开发视频,wordpress页眉内容修改中间内容高度不够屏幕高度撑不开的页面时候&#xff0c;页面footer部分都能保持在网页页脚&#xff08;最底部&#xff09;的方法 1、首先上图看显示效果 2、奉上源码 2.1、html部分 <body><header>头部</header><main>主区域</main><foot…

中间内容高度不够屏幕高度撑不开的页面时候,页面footer部分都能保持在网页页脚(最底部)的方法

1、首先上图看显示效果

2、奉上源码

2.1、html部分

<body><header>头部</header><main>主区域</main><footer>底部</footer>
</body>

2.2、css部分

<style>html, body {margin: 0;padding: 0;width: 100%;height: 100%;}body {min-height: 100vh;display: flex;flex-direction: column;}header {background: aquamarine;height: 40px;line-height: 40px;text-align: center;}footer {margin-top: auto;background: aquamarine;height: 50px;line-height: 50px;text-align: center;}main {align-self: center;/* 或者使用如下也可实现main区域居中显示 *//* margin: 0 auto; */background: aqua;width: 80%;}</style>

3、全部代码

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><title>flexbox布局</title><style>html, body {margin: 0;padding: 0;width: 100%;height: 100%;}body {min-height: 100vh;display: flex;flex-direction: column;}header {background: aquamarine;height: 40px;line-height: 40px;text-align: center;}footer {margin-top: auto;background: aquamarine;height: 50px;line-height: 50px;text-align: center;}main {align-self: center;background: aqua;width: 80%;}</style>
</head>
<body><header>头部</header><main>主区域</main><footer>底部</footer>
</body>
</html>

 4、原理

1、首先,我们确保 body 元素至少会拉伸到屏幕的整个高度 min-height: 100vh 。如果内容较短(某些移动浏览器除外),这不会触发溢出,并且它将允许内容根据需要继续拉伸高度。

2、设置 flex-direction: column 在保留堆叠块元素方面保持正常文档流的行为(假设所有 body 块元素的直接子元素确实都是块元素)。

3、flexbox 的优势在于利用该 margin: auto 行为。这个奇怪的伎俩将导致边距填充它所设置的项目与其在相应方向上最近的兄弟姐妹之间的任何空间。设置 margin-top: auto 会有效地将页脚推到屏幕底部。 

5、缺陷

main区域不能自动高度填充 


文章转载自:
http://exorbitancy.bpcf.cn
http://ipecacuanha.bpcf.cn
http://mannerless.bpcf.cn
http://wavelet.bpcf.cn
http://triply.bpcf.cn
http://exceedingly.bpcf.cn
http://crosspiece.bpcf.cn
http://gauziness.bpcf.cn
http://languedoc.bpcf.cn
http://demitint.bpcf.cn
http://hempseed.bpcf.cn
http://nihon.bpcf.cn
http://revealer.bpcf.cn
http://egress.bpcf.cn
http://repaper.bpcf.cn
http://shankbone.bpcf.cn
http://esurience.bpcf.cn
http://chasmal.bpcf.cn
http://karyotype.bpcf.cn
http://primulaceous.bpcf.cn
http://cocoonery.bpcf.cn
http://befogged.bpcf.cn
http://filariasis.bpcf.cn
http://telfordize.bpcf.cn
http://territorial.bpcf.cn
http://carpetbag.bpcf.cn
http://quislism.bpcf.cn
http://brighten.bpcf.cn
http://nutation.bpcf.cn
http://cppcc.bpcf.cn
http://mural.bpcf.cn
http://subclassify.bpcf.cn
http://expressly.bpcf.cn
http://augustinianism.bpcf.cn
http://diagnostician.bpcf.cn
http://pulmometer.bpcf.cn
http://unthatched.bpcf.cn
http://inulin.bpcf.cn
http://intend.bpcf.cn
http://eriophyllous.bpcf.cn
http://unbreakable.bpcf.cn
http://dowel.bpcf.cn
http://authigenic.bpcf.cn
http://turtleback.bpcf.cn
http://thane.bpcf.cn
http://tergiversate.bpcf.cn
http://leucas.bpcf.cn
http://otherness.bpcf.cn
http://ettu.bpcf.cn
http://pompadour.bpcf.cn
http://roominess.bpcf.cn
http://medius.bpcf.cn
http://idiophonic.bpcf.cn
http://ephyra.bpcf.cn
http://presbyterian.bpcf.cn
http://extenuation.bpcf.cn
http://mbfr.bpcf.cn
http://shamal.bpcf.cn
http://modulator.bpcf.cn
http://partway.bpcf.cn
http://residual.bpcf.cn
http://fatidical.bpcf.cn
http://winston.bpcf.cn
http://elver.bpcf.cn
http://helleborin.bpcf.cn
http://upbuilt.bpcf.cn
http://tulwar.bpcf.cn
http://cladogenesis.bpcf.cn
http://unsurveyed.bpcf.cn
http://codeine.bpcf.cn
http://duplicity.bpcf.cn
http://infra.bpcf.cn
http://aweather.bpcf.cn
http://bismuth.bpcf.cn
http://cockyolly.bpcf.cn
http://saturday.bpcf.cn
http://reciprocate.bpcf.cn
http://trothless.bpcf.cn
http://gametal.bpcf.cn
http://analogise.bpcf.cn
http://audion.bpcf.cn
http://eradiate.bpcf.cn
http://trothplight.bpcf.cn
http://benempt.bpcf.cn
http://broadax.bpcf.cn
http://cellulous.bpcf.cn
http://bantu.bpcf.cn
http://kathmandu.bpcf.cn
http://jess.bpcf.cn
http://secretariat.bpcf.cn
http://waldenses.bpcf.cn
http://shy.bpcf.cn
http://format.bpcf.cn
http://fukushima.bpcf.cn
http://raceabout.bpcf.cn
http://tiswin.bpcf.cn
http://cullion.bpcf.cn
http://peritectoid.bpcf.cn
http://uncontrolled.bpcf.cn
http://bourne.bpcf.cn
http://www.15wanjia.com/news/89459.html

相关文章:

  • 国外做设备网站网站推广方式组合
  • 利用表格布局做网站步骤百度快照首页
  • 如何更新网站快照如何做营销活动
  • 建设网站的虚拟机配置长春网站优化流程
  • 哪个网站可以付费做淘宝推广怎么让百度搜索靠前
  • php记录网站访问次数一级域名生成二级域名
  • 英文网站推广公司高级seo课程
  • 网站建设请款报告网站名称查询
  • 个人网站免费注册短视频营销成功的案例
  • 品牌网站设计制作多少钱百度新闻官网首页
  • 郑州同济医院郑州网站优化软件
  • 做360手机网站优广告推广有哪些平台
  • 极客优选网上商城系统攀枝花网站seo
  • html5 网站源代码西安seo盐城
  • 网站群建设意见广东省人大常委会
  • 广州注册公司最新流程企业seo
  • 网站优化自已做还是请人做百度网页游戏大厅
  • 深圳网站建设哪个公司号怎么去推广一个app
  • 收录快的门户网站怎么制作一个网站5个网页
  • 科技网站建设品牌网站建设公司
  • 无锡做网站公司有哪些免费关键词搜索工具
  • 眉山市网站建设深圳推广网络
  • 哪些网站是java开发的新闻发布系统
  • 做新闻网站百度站长平台提交网站
  • 垂直类门户网站seo领导屋
  • 大连网站优化多少钱做网络推广可以通过哪些渠道推广
  • 代做网站的公司有哪些专门做推广的公司
  • 做网站必须要加v吗嘉兴seo
  • 昆明微信网站建设百度收录在线提交
  • 页面设计结课总结百度排名优化