为什么我的内联块跨度继承高度?

时间:2015-09-05 01:17:46

标签: html css

我的子元素的 /* "APY.c", APY Calculator Name: Tanner Oelke Date: 2015/09/01 */ #include <stdio.h> #include <stdlib.h> #include <math.h> int main(void) { //define variables double apy, nominalIntRate; //ask user for interest rate printf("Please enter nominal interest rate:"); scanf("%lf", &nominalIntRate); //calculates apy apy = exp(nominalIntRate) -1; printf("The APY is: %.4lf\n", &nominalIntRate); return 0; } height以及以下CSS:

20px

enter image description here

父元素的display: inline-block; text-align: right; width: 67px; height: inherit; height

enter image description here

为什么我的元素没有继承这个高度?

HTML

47px

CSS

<div class='tango-directive-template'>

<div class='tango level-{{ level }}'>
  <span class='left-icons'>
    <img
      ng-show='tango.children.length > 0'
      src='/assets/images/show-arrow.png'>
    <span class='author'>A</span>
  </span>
  <textarea
    ng-focus='focus = true;'
    ng-blur='focus = false;'
    rows='1'>{{ tango.text }}</textarea>
  <p class='menu' ng-show='focus'>
    <span class='glyphicon glyphicon-indent-left'></span>
    <span class='glyphicon glyphicon-indent-right'></span>
    <span class='glyphicon glyphicon-arrow-down'></span>
    <span class='glyphicon glyphicon-arrow-right'></span.
  </p>
</div>

<tango
  ng-repeat='subtango in tango.children'
  tango='subtango'
  level='{{ +level + 1 }}'>
</tango>

</div>

我想要的是在textarea调整大小时图像垂直居中。

enter image description here

1 个答案:

答案 0 :(得分:3)

来自MDN docs

  

inherit CSS值使得指定它的元素从其父元素中获取属性的computed value。它允许在每个CSS属性上使用。

您在开发人员工具中检查的内容不是计算值,而是所谓的used value,不能继承。

要使高度可继承,您需要在父元素上指定