简体   繁体   English

对齐ul li元素

[英]aligning ul li elements

JSFiddle 的jsfiddle

I have a list of items where each <li> contains an image that should be on the left and a descriptor that should be on the right. 我有一个项目列表,其中每个<li>包含一个应该在左侧的图像和一个应该在右侧的描述符。 These two elements should align along their top axis. 这两个元素应沿其顶轴对齐。 For some reason, the first descriptor is aligned with the second image, the second descriptor with the third image, etc. I'm not at all sure what's going on. 出于某种原因,第一个描述符与第二个图像对齐,第二个描述符与第三个图像对齐,等等。我完全不确定发生了什么。 Any ideas? 有任何想法吗?

I've created a JSFiddle (above) and an image of what I'm going for (below). 我创建了一个JSFiddle(上图)和一个我想要的图像(下图)。

在此输入图像描述

Here you go, this should set you on the right path: 在这里,这应该让你走在正确的道路上:

http://jsfiddle.net/aPkyQ/7/ http://jsfiddle.net/aPkyQ/7/

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM