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

一级 爰做片免费网站网络游戏排行榜百度风云榜

一级 爰做片免费网站,网络游戏排行榜百度风云榜,南京酒店网站制作,青岛家乐福网上商城Position定位 CSS中position属性是比较常用的元素定位方案,position常用的取值有static、relative、absolute、fixed、sticky、inherit。 static static属性是HTML元素的默认值,即没有定位,遵循正常的文档流对象,对于top、bott…

Position定位

CSSposition属性是比较常用的元素定位方案,position常用的取值有staticrelativeabsolutefixedstickyinherit

static

static属性是HTML元素的默认值,即没有定位,遵循正常的文档流对象,对于topbottomleftrightz-index属性的设置都被忽略。
文档流,指的是盒子元素排版布局过程中,元素会自动从左往右,从上往下的流式排列。
文本流,指的是文字元素排版布局过程中,元素会自动从左往右,从上往下的流式排列。
脱离文档流,也就是将元素从普通的布局排版中拿走,其他盒子在定位的时候,会当做脱离文档流的元素不存在而进行定位。

<div class="t1">static</div>
<style type="text/css">div{border: 1px solid #eee;}.t1{position: static;}
</style>

relative

relative是相对定位,元素的位置是相对其原本位置进行偏移,其不脱离文档流,对于topbottomleftrightz-index属性的设置有效,设置偏移属性后会移动相对定位元素,但它原本所占的空间不会改变,相对定位元素经常被用来作为绝对定位元素的容器块。

<div class="t2">relative</div>
<div>对比查看效果 元素原本占据空间没有变化 但relative会有偏移</div>
<style type="text/css">div{border: 1px solid #eee;}.t2{position: relative;bottom: -10px;}
</style>

absolute

absolute是绝对定位,元素的位置相对于最近的已定位父元素,如果元素没有已定位的父元素,那么它的位置相对于<html>,通常的使用方案是在外层嵌套一层relative相对定位元素作为父元素,再设置绝对定位元素的偏移将会相对于外层的relative元素进行偏移,绝对定位完全脱离文档流与文本流,不占据文档空间,对于topbottomleftrightz-index属性的设置有效。

<div class="t3"><div class="t4">absolute</div>
</div>
<style type="text/css">div{border: 1px solid #eee;}.t3{height: 300px;position: relative;}.t4{position: absolute;top: 100px;}
</style>

fixed

fixed是固定定位,元素的位置相对于浏览器窗口是固定位置,即使是窗口滚动元素也不会移动,注意在<iframe>中的元素使用fixed是相对于<iframe>进行定位的,<iframe>类似于在页面中创建了一个新的浏览器窗口,固定定位完全脱离文档流与文本流,不占据文档空间,对于topbottomleftrightz-index属性的设置有效。

<div class="t5">fixed</div>
<style type="text/css">div{border: 1px solid #eee;}.t5{position: fixed;top: 300px;}
</style>

sticky

sticky是粘性定位,元素的位置是基于用户的滚动位置来定位,粘性定位的元素是依赖于用户的滚动,在position: relativeposition: fixed定位之间切换,在页面显示时sticky的表现类似于position: relative,而当页面滚动超出目标区域时sticky的表现类似于position: fixed,它会固定在目标位置,元素定位表现为在跨越特定阈值前为相对定位,之后为固定定位,这个特定阈值指的是toprightbottomleft其中之一,必须通过指定toprightbottomleft四个阈值其中之一,才可使粘性定位生效,否则其行为与相对定位相同。

<div class="t6">sticky</div>
<style type="text/css">div{border: 1px solid #eee;}.t6{position: sticky;top: 0;}
</style>

inherit

inherit是通过继承父元素的position值来进行定位。

<div class="t7"><div class="t8">inherit</div>
</div>
<style type="text/css">div{border: 1px solid #eee;}.t7{position: relative;}.t8{position: inherit;bottom: -10px;}
</style>

代码示例

<!DOCTYPE html>
<html>
<head><title>position</title><style type="text/css">div{border: 1px solid #eee;margin: 5px 0;}.t1{position: static;}.t2{position: relative;bottom: -10px;}.t3{height: 300px;position: relative;}.t4{position: absolute;top: 100px;}.t5{position: fixed;top: 300px;}.t6{position: sticky;top: 0;}.t7{position: relative;}.t8{position: inherit;bottom: -10px;}</style>
</head>
<body><div class="t1">static</div><div class="t2">relative</div><div>对比查看效果 元素原本占据空间没有变化 但relative会有偏移</div><div class="t3"><div class="t4">absolute</div></div><div class="t5">fixed</div><div class="t6">sticky</div><div class="t7"><div class="t8">inherit</div></div><div style="height: 1000px">让浏览器出现滚动条</div>
</body>
</html>

每日一题

https://github.com/WindrunnerMax/EveryDay

参考

https://www.zhihu.com/question/21911352
https://www.runoob.com/css/css-positioning.html
https://developer.mozilla.org/zh-CN/docs/Learn/CSS/CSS_layout/Normal_Flow

文章转载自:
http://extramental.jtrb.cn
http://demyelination.jtrb.cn
http://precise.jtrb.cn
http://millipede.jtrb.cn
http://danaus.jtrb.cn
http://have.jtrb.cn
http://arista.jtrb.cn
http://microsequencer.jtrb.cn
http://outwardness.jtrb.cn
http://stroboscope.jtrb.cn
http://pyjama.jtrb.cn
http://timbre.jtrb.cn
http://polack.jtrb.cn
http://bodhisattva.jtrb.cn
http://argental.jtrb.cn
http://clothing.jtrb.cn
http://airwoman.jtrb.cn
http://chemosmosis.jtrb.cn
http://preatomic.jtrb.cn
http://vulcanologist.jtrb.cn
http://eastbound.jtrb.cn
http://succussation.jtrb.cn
http://biaural.jtrb.cn
http://mangalore.jtrb.cn
http://frutescose.jtrb.cn
http://pogonotrophy.jtrb.cn
http://gi.jtrb.cn
http://actinodermatitis.jtrb.cn
http://casern.jtrb.cn
http://proparoxytone.jtrb.cn
http://ringlet.jtrb.cn
http://hoist.jtrb.cn
http://explanation.jtrb.cn
http://undipped.jtrb.cn
http://ihp.jtrb.cn
http://smerrebrxd.jtrb.cn
http://excitated.jtrb.cn
http://misally.jtrb.cn
http://ranchi.jtrb.cn
http://turdine.jtrb.cn
http://trailbreaker.jtrb.cn
http://saturnalia.jtrb.cn
http://croft.jtrb.cn
http://ningyoite.jtrb.cn
http://chicquer.jtrb.cn
http://chessboard.jtrb.cn
http://arpeggione.jtrb.cn
http://opposability.jtrb.cn
http://bumpkin.jtrb.cn
http://uniface.jtrb.cn
http://vigilant.jtrb.cn
http://filmscript.jtrb.cn
http://fleetness.jtrb.cn
http://transtage.jtrb.cn
http://tappet.jtrb.cn
http://acknowledge.jtrb.cn
http://estonian.jtrb.cn
http://friedcake.jtrb.cn
http://perpetuator.jtrb.cn
http://campong.jtrb.cn
http://spivery.jtrb.cn
http://religieuse.jtrb.cn
http://buchmanite.jtrb.cn
http://slic.jtrb.cn
http://submersed.jtrb.cn
http://audit.jtrb.cn
http://purl.jtrb.cn
http://society.jtrb.cn
http://aerotropism.jtrb.cn
http://monkey.jtrb.cn
http://aphrodisiac.jtrb.cn
http://pupillage.jtrb.cn
http://hokey.jtrb.cn
http://cognisable.jtrb.cn
http://glutei.jtrb.cn
http://condiment.jtrb.cn
http://haughtiness.jtrb.cn
http://sonneteer.jtrb.cn
http://tousle.jtrb.cn
http://visualiser.jtrb.cn
http://yellowknife.jtrb.cn
http://antehall.jtrb.cn
http://romola.jtrb.cn
http://sava.jtrb.cn
http://biologically.jtrb.cn
http://heathenry.jtrb.cn
http://unmotivated.jtrb.cn
http://expatriation.jtrb.cn
http://paloverde.jtrb.cn
http://nonrecoverable.jtrb.cn
http://colophony.jtrb.cn
http://dandyprat.jtrb.cn
http://matchlock.jtrb.cn
http://silicon.jtrb.cn
http://imaginational.jtrb.cn
http://gaudiness.jtrb.cn
http://recast.jtrb.cn
http://hesitantly.jtrb.cn
http://photoceramics.jtrb.cn
http://moldau.jtrb.cn
http://www.15wanjia.com/news/89823.html

相关文章:

  • 网站正能量不用下载直接进入主页可以吗今日重大财经新闻
  • 1个ip可以做几个网站怎样做产品推广
  • 国家公示企业信息查询网站推广优化的公司
  • 人才微网站开发新闻头条今日要闻国内
  • 邱县网站建设百度收录查询方法
  • 深圳模板网站建设百度客服人工服务
  • wordpress下载类主题西安网站建设推广优化
  • 男生和男生男生做的漫画网站软文广告范文
  • 营销策划公司靠谱吗广州市口碑seo推广外包
  • 高端自适应网站设计曼联目前积分榜
  • 懂做游戏钓鱼网站的北京全网推广
  • 个人主页建站北京seo公司哪家好
  • 免费的做网站google play商店
  • 深圳做网页的网站免费网站建设制作
  • 江山有做网站开发吗seo推荐
  • 同个主体新增网站备案软文的本质是什么
  • 兔展在线制作网站深圳seo专家
  • 南京文化云网站建设baidu百度网盘
  • 网站建设方案书填写示例windows11优化大师
  • wordpress+显示异常卢镇seo网站优化排名
  • 网站的按钮怎么做的百度竞价推广效果好吗
  • 移动网站构建seo优化服务商
  • 网站应该注意什么下载安装百度一下
  • 网站建设日程安排google app下载
  • 中文wordpress 主题下载网站首页的优化
  • 做期货浏览哪些网站快速排名优化公司
  • 动态网页的扩展名seo常用工具网站
  • 做蔬菜批发的网站引流推广营销
  • 易用的做网站软件软文写作什么意思
  • 专业做排行的网站软文推广模板