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

网站建设费1万多入什么科目软文推广多少钱

网站建设费1万多入什么科目,软文推广多少钱,手机端bootstrap模板,网站开发gxjzdrj一 、传统网页布局的三种方式 网页布局的本质–用CSS来摆放盒子,把盒子摆放到相应的位置,css提供了三种传统布局方式,分别是标准流,浮动和定位三种。 二、 定位 2.1 啥是定位 我的理解,就是要把这个元素&#xff0c…

一 、传统网页布局的三种方式

网页布局的本质–用CSS来摆放盒子,把盒子摆放到相应的位置,css提供了三种传统布局方式,分别是标准流浮动定位三种。

二、 定位 

2.1 啥是定位

我的理解,就是要把这个元素,放在哪个位置,这就是定位。

2.2 实现定位

通过属性 position 实现

2.3 定位的四种方式

前提,页面中有4个box.

 

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title></title><style>.box{background-color: aquamarine;width: 100px;height: 100px;}.box1{background-color: aqua;width: 120px;height: 120px;}.box2{background-color: olive;width: 150px;height: 150px;}.box3{background-color: olive;background-color: chocolate;width: 180px;height: 180px;}</style></head><body><div class="box">box</div><div class="box1">box1</div><div class="box2">box2</div><div class="box3">box3</div></body>
</html>

2.3.1 静态定位

设置方式为position: static;

静态定位的盒子是标准流状态,用于取消定位。

静态定位的盒子处于网页的最底层,并且top、left、bottom、right属性都不起作用。

2.3.2 相对定位

设置方式为position: relative;

相对定位:相对于原来在文档流的位置进行偏移

相对定位的盒子没有脱离标准流,在页面中占据位置,盒子的层级高于标准流和浮动的盒子,top、left、bottom、right属性都会起作用。

设置了top、left、bottom、right属性后,相对定位的盒子是相对自己在标准流中的位置进行偏移,但是盒子在页面中占据的位置是不会改变的。

操作:

设置box1 ,相对定位,进行偏移.

			.box1{background-color: aqua;width: 120px;height: 120px;position: relative;left: 20px;bottom: 2.5rem;}

效果:

box1 相对于原来在文档流的位置进行偏移

 

2.3.3 绝对定位

设置方式为position: absolute;

绝对定位的盒子脱离了标准流,在页面中不占位置.

盒子的层级高于标准流和浮动的盒子,top、left、bottom、right属性都会起作用。

注意:

设置了top、left、bottom、right属性后,绝对定位的盒子是相对设置了定位属性(静态定位不算)的最近的父级盒子的位置进行偏移,

如果没有设置了定位的父级盒子,则是相对于body标签进行偏移。

绝对定位的盒子可以通过设置z-index属性改变层级。

举例:

设置绝对属性,的元素,它的最近的父类没有设置定位,则相对于body标签进行偏移。

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title></title><style>.box{background-color: aquamarine;width: 100px;height: 100px;}.box1{background-color: aqua;width: 120px;height: 120px;position: absolute;left: 20px;bottom: 2.5rem;}.box2{background-color: olive;width: 150px;height: 150px;}.box3{background-color: olive;background-color: chocolate;width: 180px;height: 180px;}</style></head><body><div class="box">box</div><div class="box1">box1</div><div class="box2">box2</div><div class="box3">box3</div></body>
</html>

绝对定位的元素box1,相对于body进行了偏移 

 

 举例:

设置绝对属性,的元素,与它最近的父级盒子的位置进行偏移。

如下图,box6 设置了绝对定位。box6的父类id=app 设置了相对定位。

则box6的位置,是相对于它的app父类进行偏移的。

 

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title></title><style>#app{background-color: chartreuse;position: relative;height: 200px;}.box5{background-color: aquamarine;width: 100px;height: 100px;}.box6{background-color: aqua;width: 120px;height: 120px;position: absolute;left: 200px;}.box{background-color: aquamarine;width: 100px;height: 100px;}.box1{background-color: aqua;width: 120px;height: 120px;}.box2{background-color: olive;width: 150px;height: 150px;}.box3{background-color: olive;background-color: chocolate;width: 180px;height: 180px;}</style></head><body><div class="box">box</div><div class="box1">box1</div><div class="mybigbox" id="app"><div class="box5">box5</div><div class="box6">box6</div></div><div class="box2">box2</div><div class="box3">box3</div></body>
</html>

案例:

实现banner,两侧的滑动按钮。

父类设置相对定位,子类设置绝对定位。

 

<!DOCTYPE html>
<html><head><meta charset="utf-8"><title></title><style>#app{background-color: chartreuse;position: relative;height: 200px;}.box5{background-color: aquamarine;width: 100px;height: 100px;position: absolute;left: 200px;top: 40%;}.box6{background-color: aqua;width: 100px;height: 100px;position: absolute;right: 200px;top: 40%;}.box{background-color: aquamarine;width: 100px;height: 100px;}.box1{background-color: aqua;width: 120px;height: 120px;}.box2{background-color: olive;width: 150px;height: 150px;}.box3{background-color: olive;background-color: chocolate;width: 180px;height: 180px;}</style></head><body><div class="mybigbox" id="app"><div class="box5">box5</div><div class="box6">box6</div></div><div class="box">box</div><div class="box1">box1</div><div class="box2">box2</div><div class="box3">box3</div></body>
</html>

2.3.4 固定定位

设置方式为position: fixed;

固定定位的盒子脱离了标准流,在页面中不占位置,

盒子的层级高于标准流和浮动的盒子,top、left、bottom、right属性都会起作用。

设置了top、left、bottom、right属性后,固定定位的盒子是相对浏览器串口进行偏移。不管浏览器滚动条如何滚动,固定定位的盒子永远显示在浏览器窗口,不会出现滚动条往下滚动后就看不到固定定位的盒子的情况。因此固定定位的盒子常用于做底部导航栏和顶部导航栏。

固定定位的盒子可以通过设置z-index属性改变层级。

固定定位的盒子默认的宽高由其内容决定。

			.box{background-color: aquamarine;position: fixed;right: 20px;width: 100px;height: 100px;}


 

http://www.dt0577.cn/news/9000.html

相关文章:

  • 徐州润金城开发公司某网站seo诊断分析
  • 诸暨广川建设公司网站镇江交叉口优化
  • 膜结构行业做网站站内优化seo
  • 网站备案查询平台怎么从网上找客户
  • 怎样做线上销售谷歌seo服务
  • 客户问 你们网站怎么做的全网seo优化电话
  • 寻找做电影网站团队合作百度外推排名
  • c 做彩票网站个人怎么做互联网推广平台
  • 深圳手机网站制作流氓网站
  • 怎样自己免费做一个网址上海搜索排名优化公司
  • 怎样做网站发布信息百度在线客服问答
  • 网址站点异常怎么解决重庆网页优化seo
  • 南京做网站优化多少钱百度seo搜索
  • 网站建设面临的困难广告投放平台
  • 陕西建站seo为什么要进行外部优化
  • 实时更新|新冠肺炎疫情地图seo优化标题
  • 做网站的叫云啥重庆搜索排名提升
  • 中文网站建设入门网站推广方案范文
  • 爱站网app体育热点新闻
  • 那个网站上找工程造价私活做seo云优化外包
  • dede网站架设教程百度网盘资源免费搜索引擎入口
  • 品牌网站开发特点百度客服投诉中心
  • 没有独立ip如何解析网站seo综合查询平台
  • 做营销型网站价格网站外部优化的4大重点
  • 天津外贸公司网站制作营销 推广
  • 网站网页设计制作教程杭州seook优屏网络
  • 个人网站建设好之后怎么赚钱网络营销的期末试题及答案
  • .net网站开发工具介绍搜什么关键词你都懂的
  • 网站怎么做二维码相城seo网站优化软件
  • 做模特网站网络链接推广