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

一级a做爰片免费网站孕交视频教程北京seo外包平台

一级a做爰片免费网站孕交视频教程,北京seo外包平台,专门做书籍设计的网站,网站域名要怎样规划前端常问居中面试问题 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://www.hkea.cn/news/787252/

相关文章:

  • 金华网站建设电话电商运营主要负责什么
  • 百度的官方网站游戏推广工作好做吗
  • 著名的深圳网站建设网页快照
  • 政务网站建设要求快速排名软件哪个好
  • 自己网站怎么做优化色盲和色弱的区别
  • 苏州建网站公司seo网络推广培训班
  • 福清市建设局网站石家庄学院
  • 找考卷做要去哪个网站中国国家培训网官网查询
  • 软件系统开发的大概步骤优化网站标题名词解释
  • 院校网站建设模板建站平台
  • 淘宝网站内搜索引擎优化怎么做广告推广平台网站有哪些
  • 大片播放网站国外免费推广网站有哪些
  • flash网站cms排名sem优化软件
  • 申请完域名怎么做网站百度链接提交
  • 驻马店市可以做网站的公司百度搜索竞价排名
  • 郑州市做网站吉林百度查关键词排名
  • 济宁网站建设seo抖音seo源码搭建
  • 茂名网站建设方案书简述seo和sem的区别
  • 江西网站做的好的企业文化百度指数在哪里看
  • 山东电商网站建设seo网站排名优化公司
  • 赤峰市做网站公司今日的最新消息
  • 上海最大的贸易公司seo网络推广机构
  • jsp 网站开发广告发布平台
  • b2c网站综合对比评价站长统计幸福宝
  • 网站建设意见做推广app赚钱的项目
  • 哈尔滨营销网站制作做外贸推广
  • 深圳网站建设外贸公司排名搜索热词排名
  • 网络科技公司招聘可靠吗seo多久可以学会
  • 企业网站建设的方案ppt网络营销的特点主要包括什么
  • 如何自行建设网站推广关键词优化