我花了一些时间在这个网站上用div层创建一个谱系,我把它完全对齐了.
但是当我在其中放入文本时,无论是在div还是在p标签中,它都会显着降低div层.
在检查元素时,它似乎没有添加任何边距或填充或其他任何东西,它似乎不会影响孙子div层.
HTML:
<div id="pedigree">
<div id="parentwrap">
<div class="parent">test</div>
</div>
<div id="childwrap">
<div class="child">
<p>Am. Ch. Kenai's Aldebaran</p>
</div>
<div class="child">
<p>pAm. Ch. Santa Clara Del Viento</p>
</div>
</div>
<div id="grandchildwrap">
<div class="grandchild">Am. Can. Ch. Ryzann's Eclipse at Kenai</div>
<div class="grandchild">Am. Ch. Timber Ridge's Abi of Kenai</div>
<div class="grandchild">Am. Ch. Sky Run Gavril Virtual Zip JC</div>
<div class="grandchild">Am. Can. Ch. Tazeb's Zena</div>
</div>
</div>
Run Code Online (Sandbox Code Playgroud)
CSS:
#pedigree {
position: relative;
width: 584px;
height: 204px;
margin: 0 auto; …Run Code Online (Sandbox Code Playgroud)