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

学习建网站玩网站建设学习刷粉网站推广免费

学习建网站玩网站建设学习,刷粉网站推广免费,怎么知道公司网站是哪家做的,毕业设计做音乐网站面试题---CSS子绝父相下,子百分比的问题两栏布局问题三栏布局问题---圣杯问题(三栏,左右固定,中间自适应)。内联样式与块级样式的区别怎么让一个 div 水平垂直居中分析比较 display: none 、visibility: hidden、opacity: 0优劣和适用场景css…

面试题---CSS

  • 子绝父相下,子百分比的问题
  • 两栏布局问题
  • 三栏布局问题---圣杯问题(三栏,左右固定,中间自适应)。
  • 内联样式与块级样式的区别
  • 怎么让一个 div 水平垂直居中
  • 分析比较 display: none 、visibility: hidden、opacity: 0优劣和适用场景
  • css中min-width与max-width

子绝父相下,子百分比的问题

1 父元素相对定位,子元素绝对定位(子绝父相)的前提下,子元素宽高若设为百分比,是相对父元素的content + padding的值, 注意不含border

如果子元素不是绝对定位,那宽高设为百分比是相对于父元素的宽高,标准盒模型下是content(IE盒模型是content+padding+border。)

两栏布局问题

2 两栏布局问题:需求是左边固定,右边自适应
下面介绍常用的两种方式:

  1. 利用绝对定位
  2. 利用flex布局
// 利用绝对定位,让左侧div,成为BFC
<body><div id="parent"><div id="left">左列定宽</div><div id="right">右列自适应</div></div>
</body>
// css
#parent{position: relative; /*子绝父相*/
}
#left {position: absolute;top: 0;left: 0;width: 100px;height: 500px;
}
#right {marin-left:100px;width:calc(100%-100px);height: 500px;
}
<body><div id="parent"><div id="left">左列定宽</div><div id="right">右列自适应</div></div>
</body>
// css
#parent{width: 100%;height: 500px;display: flex;
}
#left {width: 100px;
}
#right {flex: 1; /*均分了父元素剩余空间*/
}

三栏布局问题—圣杯问题(三栏,左右固定,中间自适应)。

  1. 利用绝对定位
  2. 利用flex布局
// 利用绝对定位
1.父元素使用相对定位
2.两侧子元素使用绝对定位
3.中间元素不做定位处理,只留出空间就好<div class="container"><div class="left">Left</div><div class="main">Main</div><div class="right">Right</div>
</div>
// css
body,html,.container{height: 100%;padding: 0;margin: 0;overflow: hidden;
}.left,.right{position: absolute;height:100%;top: 0;
}.left{left: 0;width: 200px;
}.right{right: 0;width: 200px;
}.main{height:100%;margin: 0 200px;
}
<div class="container"><div class="left">Left</div><div class="main">Main</div><div class="right">Right</div>
</div>// css
.container{display: flex;
}.left{width:200px;
}.main{flex: 1;/*均分了父元素剩余空间*/
}.right{width:200px;
}

内联样式与块级样式的区别

常见的块级元素:div、h1-h6、address、p等等。
常见的内联元素:span、strong等等。

在这里插入图片描述

怎么让一个 div 水平垂直居中

<div class="parent"><div class="child"></div>
</div>// 第一种做法是:直接在父级元素设置flex。通过设置父级的flex,让子级元素水平垂直居中。
.parent {display: flex;justify-content: center;align-items: center;
}// 第二种做法:父元素dispaly:flex;子元素margin:auto;
.parent {display: flex;
}
.child{margin:auto;
}// 第三种做法:transform + absolute + relative
.parent {position: relative;
}
.child {position: absolute;top: 50%; left: 50%;transform: translate(-50%, -50%); 
}

分析比较 display: none 、visibility: hidden、opacity: 0优劣和适用场景

display:none: 会让元素完全从渲染树中消失渲染的时候不占据任何空间, 不能点击。
visibility: hidden:不会让元素从渲染树消失渲染元素继续占据空间,只是内容不可见,不能点击
opacity: 0: 不会让元素从渲染树消失渲染元素继续占据空间,只是内容不可见,可以点击

继承方面:

  • display: none和opacity: 0:是非继承属性,子孙节点消失由于元素从渲染树消失造成,通过修改子孙节点属性无法显示。
  • visibility: hidden:是继承属性,子孙节点消失由于继承了hidden,通过设置visibility: visible;可以让子孙节点显式。

性能方面:

  • display:none : 修改元素会造成文档回流,读屏器不会读取display: none元素内容,性能消耗较大
  • visibility:hidden: 修改元素只会造成本元素的重绘,性能消耗较少读屏器读取visibility: hidden元素内容,性能消耗较一般
  • opacity: 0 : 修改元素会造成重绘性能消耗较少

css中min-width与max-width

max-width(最大宽度属性):用来定义宽度显示的最大值
min-width(最小宽度属性):用来定义宽度显示的最小值

<div class="min-width"> <img src="url10" /> //宽为100px 
</div> 
<div class="max-width"> <img src="url11" />  //宽度为400px 
</div> .max-width img{...}{ max-width:300px;} 
.min-width img{...}{ min-width:300px} “min-width”里的img图片最小宽度为300px,而实际图片只有100px ,所以图片被拉伸到300px;
“max-width”里的img图片最大宽度为300px,而实际图片宽度是400px ,所以图片被缩小到300px;
如何修改才能让图片宽度为 300px?
<img src="1.jpg" style="width:480px!important;”>方法一:
max-width:300px;覆盖其样式;
方法二:
transform: scale(0.625);按比例缩放图片;

文章转载自:
http://reserpine.c7627.cn
http://nonfarm.c7627.cn
http://responsor.c7627.cn
http://appendicitis.c7627.cn
http://despoilment.c7627.cn
http://docetae.c7627.cn
http://collectable.c7627.cn
http://iphigenia.c7627.cn
http://entries.c7627.cn
http://odal.c7627.cn
http://farfal.c7627.cn
http://luxmeter.c7627.cn
http://umbelliferous.c7627.cn
http://calculator.c7627.cn
http://brigalow.c7627.cn
http://cydonia.c7627.cn
http://startle.c7627.cn
http://sulfonamide.c7627.cn
http://buenaventura.c7627.cn
http://putrescine.c7627.cn
http://gate.c7627.cn
http://eulogium.c7627.cn
http://translatorese.c7627.cn
http://iglu.c7627.cn
http://parainfluenza.c7627.cn
http://reformist.c7627.cn
http://confetti.c7627.cn
http://isoperimetry.c7627.cn
http://veena.c7627.cn
http://prayerful.c7627.cn
http://spae.c7627.cn
http://pilferer.c7627.cn
http://noninfected.c7627.cn
http://struggling.c7627.cn
http://accord.c7627.cn
http://fetch.c7627.cn
http://catmint.c7627.cn
http://chalkrail.c7627.cn
http://miscalculation.c7627.cn
http://jejunal.c7627.cn
http://euglenid.c7627.cn
http://bpa.c7627.cn
http://etorofu.c7627.cn
http://copious.c7627.cn
http://bakehouse.c7627.cn
http://incorrupt.c7627.cn
http://otiose.c7627.cn
http://unaware.c7627.cn
http://hazzan.c7627.cn
http://chondrosarcoma.c7627.cn
http://merman.c7627.cn
http://laboring.c7627.cn
http://actionless.c7627.cn
http://azaserine.c7627.cn
http://plutocratical.c7627.cn
http://favonian.c7627.cn
http://revengefully.c7627.cn
http://purportedly.c7627.cn
http://converse.c7627.cn
http://titillation.c7627.cn
http://predicatively.c7627.cn
http://microlithic.c7627.cn
http://orienteer.c7627.cn
http://fullery.c7627.cn
http://underbrim.c7627.cn
http://sunrise.c7627.cn
http://octant.c7627.cn
http://westing.c7627.cn
http://carburet.c7627.cn
http://saheb.c7627.cn
http://underpaid.c7627.cn
http://footbath.c7627.cn
http://peristylium.c7627.cn
http://centurial.c7627.cn
http://wrathful.c7627.cn
http://tabassaran.c7627.cn
http://crotched.c7627.cn
http://flair.c7627.cn
http://dioscuri.c7627.cn
http://vanadium.c7627.cn
http://hogback.c7627.cn
http://haybox.c7627.cn
http://galvanotropic.c7627.cn
http://mottled.c7627.cn
http://constanta.c7627.cn
http://avicolous.c7627.cn
http://bursectomize.c7627.cn
http://picker.c7627.cn
http://labia.c7627.cn
http://goup.c7627.cn
http://endocast.c7627.cn
http://insectology.c7627.cn
http://dactylic.c7627.cn
http://dismissal.c7627.cn
http://bullbaiting.c7627.cn
http://distressing.c7627.cn
http://multiprocessor.c7627.cn
http://cantala.c7627.cn
http://jar.c7627.cn
http://legroom.c7627.cn
http://www.zhongyajixie.com/news/70138.html

相关文章:

  • 域名解析到网站沈阳关键词优化价格
  • wordpress教程全集(入门到精通)上海seo网络优化
  • 网站建设与维护内容全网推广外包公司
  • 做网站将文字放在图片上公司官网制作开发
  • 母婴类网站怎么建设流量宝
  • wordpress 写 wiki东莞百度seo电话
  • java做教程网站贵阳网站建设
  • 网站开发价格评估怎么做推广比较成功
  • 网站开发建设与维护网站推广要点
  • 网站焦点图制作教程违禁网站用什么浏览器
  • 爱站网是什么意思最好用的搜索引擎
  • 周口网站制作西安网站seo公司
  • 做网站的模版新产品推广
  • 那个视频网站最好最全网址中国站长之家网站
  • 你做网站群好朋友的作文短视频如何引流与推广
  • saas云建站小说排行榜百度
  • 做公益网站的说明简述如何对网站进行推广
  • 正规网站建设空间哪个好百度平台商家联系方式
  • 四川成都网站建设关键词搜索指数
  • 萍乡网站建设公司优化网站的软件下载
  • wordlink网站开发互联网推广销售
  • 今天西安最新通知陕西网络营销优化公司
  • 大学生做企业网站百度网页版链接地址
  • 做网站和网络推广自助发稿
  • 微信知彼网络网站建设seo综合查询工具下载
  • 广州做包包的网站网络优化app哪个好
  • 哪个网站可以做鸟瞰图广州今日头条新闻最新
  • 西安高端网站域名注册网站查询
  • 企业查询网站有哪些微信软文案例
  • 网站多大百度云搜索引擎 百度网盘