1. inherit是动态的

<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>
<style>
#par {
width: 300px;
color: black;
max-height: 200px;
height: 100px;
}
#child {
color: inherit;
}
</style>
</head>
<body>
<div id="par">
<div id="child">
1
</div>
</div>
</body>
<script>
setTimeout(function () {
document.getElementById('par').style.color = 'yellow'
}, 3000) 3s秒后child也是黄色
</script>
</html>

2 height: inherit和100%区别

正常情况下一样,但是当子元素是绝对定位,父元素是static时候,会有区别,100%会冲破父级,inherit,和父级一样

3 max-height: inherit和100%区别

max-height 的百分比是相对父级的高度来算的,

而inherit和父级的max-height一样

最新文章

  1. javascript中的感叹号 &quot;!&quot;
  2. Shiro-HelloWord
  3. Qt之创建桌面和开始菜单快捷方式
  4. 2.MongoDB数据库简介
  5. eclipse rcp 打包出适合不同操作系统和操作位数.
  6. .NET Core常用配置文件示例
  7. Android中GC_EXTERNAL_ALLOC的含义
  8. ajax请求后台,返回json格式数据,模板!
  9. 树莓派+qt+opencv
  10. java后端模拟表单提交
  11. Android下得到APK包含信息
  12. CentOS6.5下解压文件.tar.gz .war .zip
  13. cerr与cout区别
  14. Linux学习笔记:nohup &amp; 后台任务
  15. ruby+gem常用命令
  16. WEB项目日志分析系统思考
  17. matlab 图像Mat类型矩阵中的值(uint8)类型转换,防止溢出
  18. Oracle拆分字符串,字符串分割的函数。
  19. python_32_文件操作1
  20. Docker入门系列1:简介

热门文章

  1. windows7使用Sphinx+PHP+MySQL详细介绍
  2. bat批处理文件自动判断系统版本信息(转载)
  3. 罗技 HTPC K700
  4. U盘安装咱中国人自己的操作系统UbuntuKylin14.04LST(超具体原创图文教程)
  5. overflow:hidden 影响inline-block元素周围元素下移
  6. SharePoint Search 分词(WordBreaker)
  7. ABAP-DBC录屏
  8. jquery 中的dom操作
  9. 前端框架比较,Layui - iView - ElementUI
  10. 五、Delphi10.3通过REST单元使类和JSON数据互相转换