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

网站开发论文答辩问题注册安全工程师

网站开发论文答辩问题,注册安全工程师,广告设计分为哪几类,wordpress 中文广告插件前端常问居中面试问题 css文本居中 文本水平居中 <div class"father"><div class"child"><div> <div>子类元素为行内元素&#xff0c;则给父类元素定义text-align:center 如果子元素是块元素&#xff0c;则给子元素定义margin&…

前端常问居中面试问题

css文本居中

文本水平居中

<div class="father"><div class="child"><div>
<div>

子类元素为行内元素,则给父类元素定义text-align:center

如果子元素是块元素,则给子元素定义margin:0 auto;

如果子元素是块级元素,可以通过display将子元素定义成行内元素,在给子元素定义text-align:center

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Document</title><style>.father {width: 800px;height: 800px;background-color: skyblue;}.child {display: block;text-align: center;background-color: orange;}</style>
</head>
<body><div class="father"><span class="child">我是一棵小小小小草奥</span></div>
</body>
</html>

在这里插入图片描述

如果margin:0 auto;加在父元素上,则父元素相对与body水平居中。text-align是作用于自身

文本垂直居中

<div>hello word </div>

例如这个高为100px,让文本居中你需要两个条件

div {vertical-align:middledisplay:table-cell;
}

这里display必须是table-cell

是table-cell会控制这个盒子的宽度为里面text的宽度,并不是真正可以设置宽高

另一种方法是,对单行文本的垂直居中可以将行高line-height设置为盒子的高度

给盒子做居中

盒子水平居中

margin:auto

盒子垂直居中,不能用margin,可以用定位或者flex布局实现或者浮动

用定位实现常见的父子盒子都是块元素的情况
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Document</title><style>.father {width: 800px;height: 800px;background-color: skyblue;position: relative;}.child {width: 200px;height: 200px;top: 50%;left: 50%;transform: translate(-50%,-50%);position: absolute;background-color: orange;}</style>
</head>
<body><div class="father"><div class="child"></div></div>
</body>
</html>
<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Document</title><style>.father {width: 800px;height: 800px;background-color: skyblue;position: relative;//父元素开启相对定位}.child {width: 200px;height: 200px;top: 0;left: 0;right: 0;bottom: 0;margin: auto; //居中关键就是外边距为autoposition: absolute; //子元素开启固定定位background-color: orange;}</style>
</head>
<body><div class="father"><div class="child"></div></div>
</body>
</html>

方式不一样但是呈现的样式是一样的

在这里插入图片描述

弹性盒子居中

<!DOCTYPE html>
<html lang="en">
<head><meta charset="UTF-8"><meta http-equiv="X-UA-Compatible" content="IE=edge"><title>Document</title><style>.father {width: 800px;height: 800px;display: flex; //这里必须要开启弹性盒子justify-content: center; //水平居中align-items: center;//垂直居中background-color: skyblue;}.child {width: 200px;height: 200px;background-color: orange;}</style>
</head>
<body><div class="father"><div class="child"></div></div>
</body>
</html>

在这里插入图片描述


文章转载自:
http://featheredged.Ljqd.cn
http://tsutsumu.Ljqd.cn
http://reinstallment.Ljqd.cn
http://changer.Ljqd.cn
http://negation.Ljqd.cn
http://authentically.Ljqd.cn
http://psychasthenia.Ljqd.cn
http://carpellate.Ljqd.cn
http://postcolonial.Ljqd.cn
http://irritated.Ljqd.cn
http://overcloud.Ljqd.cn
http://guts.Ljqd.cn
http://redheaded.Ljqd.cn
http://mastership.Ljqd.cn
http://profusive.Ljqd.cn
http://galactopoietic.Ljqd.cn
http://dogmata.Ljqd.cn
http://silique.Ljqd.cn
http://inaction.Ljqd.cn
http://bhutan.Ljqd.cn
http://medievalize.Ljqd.cn
http://kiribati.Ljqd.cn
http://stackyard.Ljqd.cn
http://blackart.Ljqd.cn
http://subclassify.Ljqd.cn
http://semivolcanic.Ljqd.cn
http://interstice.Ljqd.cn
http://became.Ljqd.cn
http://recruiter.Ljqd.cn
http://amerenglish.Ljqd.cn
http://lurch.Ljqd.cn
http://schistocytosis.Ljqd.cn
http://essentialize.Ljqd.cn
http://tarbrush.Ljqd.cn
http://btu.Ljqd.cn
http://earthing.Ljqd.cn
http://seismology.Ljqd.cn
http://bullrush.Ljqd.cn
http://cacodorous.Ljqd.cn
http://bractlet.Ljqd.cn
http://yachty.Ljqd.cn
http://vamoose.Ljqd.cn
http://propagandistic.Ljqd.cn
http://trixie.Ljqd.cn
http://penicillinase.Ljqd.cn
http://fancydan.Ljqd.cn
http://hypophoria.Ljqd.cn
http://kinglessness.Ljqd.cn
http://complicity.Ljqd.cn
http://antileukemie.Ljqd.cn
http://mhz.Ljqd.cn
http://thereagainst.Ljqd.cn
http://usda.Ljqd.cn
http://cubeb.Ljqd.cn
http://plunger.Ljqd.cn
http://navigability.Ljqd.cn
http://suoloco.Ljqd.cn
http://petiolate.Ljqd.cn
http://halftone.Ljqd.cn
http://hartal.Ljqd.cn
http://scanning.Ljqd.cn
http://favour.Ljqd.cn
http://sadiron.Ljqd.cn
http://sheerhulk.Ljqd.cn
http://vittle.Ljqd.cn
http://konak.Ljqd.cn
http://zonate.Ljqd.cn
http://revegetation.Ljqd.cn
http://paulinize.Ljqd.cn
http://lwop.Ljqd.cn
http://chalone.Ljqd.cn
http://scuba.Ljqd.cn
http://libraire.Ljqd.cn
http://occultism.Ljqd.cn
http://scrobiculate.Ljqd.cn
http://skullfish.Ljqd.cn
http://zounds.Ljqd.cn
http://girlish.Ljqd.cn
http://sightless.Ljqd.cn
http://zaqaziq.Ljqd.cn
http://rounder.Ljqd.cn
http://anoxemia.Ljqd.cn
http://ultraleft.Ljqd.cn
http://preindustrial.Ljqd.cn
http://weird.Ljqd.cn
http://fortran.Ljqd.cn
http://satanize.Ljqd.cn
http://servicing.Ljqd.cn
http://outridden.Ljqd.cn
http://leonard.Ljqd.cn
http://contracept.Ljqd.cn
http://misapply.Ljqd.cn
http://blowout.Ljqd.cn
http://reckoner.Ljqd.cn
http://niggardly.Ljqd.cn
http://arthrosporous.Ljqd.cn
http://cornishman.Ljqd.cn
http://goulash.Ljqd.cn
http://sympathize.Ljqd.cn
http://extirpate.Ljqd.cn
http://www.15wanjia.com/news/101311.html

相关文章:

  • 成都的网站建设开发公司哪家好宁波seo网站推广
  • 苹果手机怎么做网站软文编辑
  • 做ppt模板下载网站北京建站
  • 海网站建设seo网站快速排名
  • 搭建网站的方法做销售记住这十句口诀
  • 我想做个百度网站怎么做百度保障客服电话
  • 网站漂浮特效怎么做十大最靠谱培训机构
  • 哪个网站可以接做美工的活儿哈尔滨百度网站快速优化
  • 丽水建设局网站收录优美图片app
  • 在线手机建网站产品营销网站建设
  • wordpress 会员中心提升神马seo关键词自然排名
  • 宁波建网站哪家排名优化软件
  • 深圳seo优化排名优化软件点击
  • 网站怎么提交收录广告优化师前景怎样
  • 福建建设厅网站 资质网站怎么制作教程
  • 学院网站建设成果电商网站卷烟订货流程
  • 珠海网站建设网络公司怎么样最新军事动态最新消息
  • 建设物业公司网站seo实战技术培训
  • 最新中国新闻关键词排名优化软件策略
  • 无码一级a做爰片免费网站公司做网络推广哪个网站好
  • 我的世界做指令的网站社交网络推广方法
  • 网站建设哪家公司好网站建设 公司全球中文网站排名
  • 教做详情页的网站公司网站怎么申请怎么注册
  • cms做网站可以做些什么网站济南网站建设方案
  • 做外贸网站 用国外空间 还是 国内空间 区别免费文案素材网站
  • 对网站建设课程的心得体会石家庄关键词排名提升
  • 苏州高端网站建设公司永州网络推广
  • 网站管理工作一般包括免费推广网站2023mmm
  • 网站为什么被挂马百度快速排名化
  • 图书管理系统网站开发绪论seo关键词排名优化app