< li>中的图片标签 [英] Image inside <li> tag

查看:98
本文介绍了< li>中的图片标签的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个关于< li> 标记中的浮动元素的问题。

I have a question about floating elements inside of <li> tag.

<li>
<img src="concept-truck.jpg" alt="2013 Toyota Tacoma" id="itemImg" style="float:left">
<p>2013 Toyota Tacoma</p>
<p>Price : 450000$</p>
<p>Year : 2013</p>
<p><a href="/item/index/63">more</a></p>            
</li>

在FF中,IE工作正常,但在Chrome列表计数浮动图像。
如何解决?感谢

In FF, IE works fine, but in Chrome list numeration floats image too. How to fix it? Thanks

推荐答案

我将重写您的示例如下:

I would rewrite your example like this:

<li>
    <div style="float: left;">
        <img src="concept-truck.jpg" alt="2013 Toyota Tacoma" id="itemImg">
    </div>
    <div style="float: left;">
        <p>2013 Toyota Tacoma</p>
        <p>Price : 450000$</p>
        <p>Year : 2013</p>
        <p><a href="/item/index/63">more</a></p>
    </div>
    <div style="float: none; clear: both;"></div>
</li>

这是用内联样式的CSS属性写的,我通常倾向于避免,例如,我写的就像你做的 - 内联。

This is written with inline-style CSS attributes, which I usually tend to avoid, but as in your example, I wrote it like you did - inline.

这篇关于&lt; li&gt;中的图片标签的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆