Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/76.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Html 如何将两种不同的字体大小相邻对齐?_Html_Css - Fatal编程技术网

Html 如何将两种不同的字体大小相邻对齐?

Html 如何将两种不同的字体大小相邻对齐?,html,css,Html,Css,如何将两种不同大小的字体相邻对齐,使较小的文本与较大的文本垂直居中 HTML: <div id="parent"> <span id="first">first</span> <span id="second">second</span> </div> #first { font-size: 200%; } #second { font-size: 100%; } jsiddle:

如何将两种不同大小的字体相邻对齐,使较小的文本与较大的文本垂直居中

HTML:

<div id="parent">
    <span id="first">first</span>
    <span id="second">second</span>
</div>
#first {
    font-size: 200%;   
}

#second {
    font-size: 100%;
}

jsiddle:

您可以使用
垂直对齐:中间
属性


使用行高css属性。将第一个和第二个设置为相同的线高度。

您可以这样做:

我添加了一个用于进一步的示例。

这很好

#first {
  font-size: 200%;
}


在发布答案时,请包含您的代码。小提琴不会永远演奏下去,我们希望其他人能从你的知识中受益。我投了反对票。如果有人能告诉我为什么我会很感激。
#second {
    font-size: 100%;
    vertical-align:top;
    line-height:38px;
}