Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/html/87.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/css/40.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_Html Lists - Fatal编程技术网

Html 列表项中的图像影响其他文本在其他列表项中的位置

Html 列表项中的图像影响其他文本在其他列表项中的位置,html,css,html-lists,Html,Css,Html Lists,我有一个没有编号的列表,我正试图为菜单设置格式 <ul> <li><img src="greatImage.png"></li> <li>item 2</li> <li>item 3</li> </ul> 项目2 项目3 我试图让所有列表项内容彼此垂直居中。当我将图像添加到第一个列表项时,它看起来好像所有其他列表项位置都被推到UL块的底部边界?基本上,图像

我有一个没有编号的列表,我正试图为菜单设置格式

<ul>
    <li><img src="greatImage.png"></li>
    <li>item 2</li>
    <li>item 3</li>
</ul>
  • 项目2
  • 项目3

我试图让所有列表项内容彼此垂直居中。当我将图像添加到第一个列表项时,它看起来好像所有其他列表项位置都被推到UL块的底部边界?基本上,图像会影响列表项的其他位置。

您可以做的一件事是将li的行高度设置为图像的行高度


示例:

您可以使用or向我们显示问题吗?这是列表项的正确默认外观。您是否要求项目2和项目3水平显示在图像右侧,垂直居中?