Skip to content

float:left; 惹的祸

2009 五月 18
tags:
by 荒野无灯

我现在这个风格显示图文时总是文字围在图片旁边,很混乱。
打开style.css看下:

1
2
3
4
/* images and misc. */

img{ border: none; padding: 6px; float:left;  margin-right:10px; }
img a{border:none;}

原来是img标签的

1
 float:left;

惹的祸.去掉它后页面显示正常了。
去掉它:

1
2
3
/* images and misc. */

img{ border: none; padding: 6px; margin-right:10px; }

喜欢这篇文章吗?

请订阅本站 RSS feed填写您的邮件地址,订阅我们的精彩内容:,欢迎点击这里捐赠以支持荒野无灯转播到腾讯微博 转播到腾讯微博

作者:荒野无灯
出处:Hacklog【Hacklog】

声明: 本站遵循 署名-非商业性使用-相同方式共享 3.0 共享协议. 转载请注明转自Hacklog【荒野无灯weblog】

本文链接: http://ihacklog.com/?p=2078

4 Responses Post a comment
  1. 五月 24, 2009

    一般图文混排我都会用插件来控制img标签的对齐属性和margin

  2. 五月 23, 2009

    float有时候是会有一些让人郁闷的问题的,而且原因不好找。呵呵。

    还有那个overflow也会引起不同浏览器的不同效果,而且很难定位原因。

    相对来讲,float还好些。呵呵。

  3. 五月 18, 2009

    呵呵 有时候css文件多了 我自己都懒得检查了!

Leave a Reply

Allowed Tags - You may use these HTML tags and attributes in your comment.

<a href="" title=""> <abbr title=""> <acronym title=""> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <q cite=""> <strong>

 :wink:  :-|  :-x  :twisted:  :)  8-O  :(  :roll:  :-P  :oops:  :-o  :mrgreen:  :lol:  :idea:  :-D  :evil:  :cry:  8)  :arrow:  :-?  :?:  :!:

Note: You may use basic HTML in your comments. Your email address will not be published.

Subscribe to this comment feed via RSS