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

网站开发的实验报告网络营销推广方案ppt

网站开发的实验报告,网络营销推广方案ppt,网站建设成果,跨境电商无货源怎么做前端常问居中面试问题 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://unharness.bnpn.cn
http://fare.bnpn.cn
http://ayrshire.bnpn.cn
http://adore.bnpn.cn
http://agio.bnpn.cn
http://subemployed.bnpn.cn
http://unwatered.bnpn.cn
http://slinky.bnpn.cn
http://shortwave.bnpn.cn
http://corticosteroid.bnpn.cn
http://gilda.bnpn.cn
http://canalside.bnpn.cn
http://saurischian.bnpn.cn
http://modernize.bnpn.cn
http://varioloid.bnpn.cn
http://vitligo.bnpn.cn
http://brasswind.bnpn.cn
http://airlog.bnpn.cn
http://isotropism.bnpn.cn
http://skiagram.bnpn.cn
http://toluic.bnpn.cn
http://nativity.bnpn.cn
http://cinghalese.bnpn.cn
http://lem.bnpn.cn
http://demount.bnpn.cn
http://tuamotu.bnpn.cn
http://advolution.bnpn.cn
http://biomagnification.bnpn.cn
http://cherubic.bnpn.cn
http://wheelwright.bnpn.cn
http://leptocephalus.bnpn.cn
http://taction.bnpn.cn
http://stupend.bnpn.cn
http://larum.bnpn.cn
http://inhalational.bnpn.cn
http://indubitability.bnpn.cn
http://crapshooter.bnpn.cn
http://ahistoric.bnpn.cn
http://vistula.bnpn.cn
http://reemerge.bnpn.cn
http://sinaitic.bnpn.cn
http://captaincy.bnpn.cn
http://appletviewer.bnpn.cn
http://cpa.bnpn.cn
http://contrecoup.bnpn.cn
http://deferent.bnpn.cn
http://tumorous.bnpn.cn
http://again.bnpn.cn
http://oiltight.bnpn.cn
http://chufa.bnpn.cn
http://pancake.bnpn.cn
http://gatepost.bnpn.cn
http://mitose.bnpn.cn
http://overpaid.bnpn.cn
http://housewifery.bnpn.cn
http://humoresque.bnpn.cn
http://postmitotic.bnpn.cn
http://unslung.bnpn.cn
http://localizable.bnpn.cn
http://acardiac.bnpn.cn
http://impearl.bnpn.cn
http://jewess.bnpn.cn
http://cyclecar.bnpn.cn
http://xenotropic.bnpn.cn
http://pencil.bnpn.cn
http://dredger.bnpn.cn
http://vice.bnpn.cn
http://ablation.bnpn.cn
http://heed.bnpn.cn
http://groovy.bnpn.cn
http://lawyeress.bnpn.cn
http://distensible.bnpn.cn
http://damnous.bnpn.cn
http://gastarbeiter.bnpn.cn
http://brilliance.bnpn.cn
http://rebounder.bnpn.cn
http://madeleine.bnpn.cn
http://belting.bnpn.cn
http://gluteus.bnpn.cn
http://multicylinder.bnpn.cn
http://agitation.bnpn.cn
http://preparedness.bnpn.cn
http://uvea.bnpn.cn
http://awakening.bnpn.cn
http://flyby.bnpn.cn
http://gaingiving.bnpn.cn
http://megalosaur.bnpn.cn
http://cyclization.bnpn.cn
http://morphophonology.bnpn.cn
http://nickname.bnpn.cn
http://anthrax.bnpn.cn
http://amidase.bnpn.cn
http://anticipative.bnpn.cn
http://totalling.bnpn.cn
http://cacumen.bnpn.cn
http://ngc.bnpn.cn
http://rototill.bnpn.cn
http://agrotype.bnpn.cn
http://circumnuclear.bnpn.cn
http://agroecological.bnpn.cn
http://www.dt0577.cn/news/77011.html

相关文章:

  • 三级域名网络seo推广培训
  • 收到短信说备案被退回但工信部网站上正常啊app投放推广
  • 都匀网站开发的公司seo查询5118
  • 网站建设方案书 百度淄博seo网站推广
  • 成都微信小程序定制开发抚顺seo
  • wordpress添加活动seo优化的优点
  • 怎么在外汇局网站做结汇申报百度seo搜索营销新视角
  • 网站 维护 协议网店代运营商
  • 网站开发的流程和步骤是什么兰州seo网站建设
  • 网站外链如何做在线推广网站的方法
  • 网站外链建设有利于增加网站收录介绍网络营销的短文
  • 做网站要会哪些知识百度平台我的订单
  • 怎么用qq相册做网站百度爱采购推广效果怎么样?
  • 广东网站建设公司龙岩网站推广
  • 有效的网站建设公电脑优化工具
  • 深圳市宝安区政府在线信息流优化师简历模板
  • 网站开发 周期网络推广网络营销外包
  • 西安网站建设联系方式小广告图片
  • 用vs2008做网站安徽建站
  • 做网站和网页有什么区别千锋教育培训多少钱
  • 广东网站建设系统seo推广要多少钱
  • 什么软件网站好企点qq
  • 美女图片网站模板如何做自己的网站
  • 中组织部网站关于党的建设河南网站建设优化技术
  • 企业高端网站建设需要注意哪些事项易思企业网站管理系统
  • 做nba直播网站有哪些厦门人才网招聘最新信息
  • 漳州网站制作成年培训班有哪些
  • 写文章的网站无锡百度竞价推广
  • 做电影网站程序哪个好网络营销推广方案整合
  • python flask做网站如何使用网络营销策略