Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我有一个编号列表,如下所示:
<ol> <li>some text <img src="..." /></li> </ol>
文本的图像右侧位于文本下方,而不是其右侧。我尝试了跨度和浮动:左,但这不起作用。如何将文本的图像对齐?
谢谢!
对文本和图像使用浮动,并指定图像和文本 div 的宽度,例如
<ol> <li> <div style="float:left;width:200px;" >your text here..</div> <div style="float:right;width:100px;"><img src="abc.jpg" /></div> <div style="clear:both;"></div> </li>
假设您的 li 宽度最小为 300px