自从Wordpress2.5.1开始,Wordpress对图片的支持就老是出现这样那样的问题,之前是无法上传图片的问题,需要修改.htaccess或者用一个插件才可以解决,升级到Wordpress2.6,又发现图片的对齐功能不起作用,每次插入图片,我都需要手动添加代码,以便能够按照自己的意愿让图片靠左、中、右对齐。

image align

因为手动添加代码也只是几秒钟的事情,所以也没有太在意,刚才在DailyBlogTips发现了解决的办法。

原来,自从Wordpress2.5以来,官方就有提示,如果我们需要在Wordpress中使用图片对齐功能,就必须在你所用主题的style.css中添加如下代码:

img.centered {
display: block;
margin-left: auto;
margin-right: auto;
}

img.alignright {
padding: 4px;
margin: 0 0 2px 7px;
display: inline;
}

img.alignleft {
padding: 4px;
margin: 0 7px 2px 0;
display: inline;
}

.alignright {
float: right;
}

.alignleft {
float: left;
}

OK,现在又恢复正常了,如果你正为这个问题烦恼的话,现在应该知道怎么解决了吧?

如果你喜欢本文,你可以 订阅本站全文Feed,以便获取更多相关的信息。

转载原创文章请注明出处,本文永久链接:http://www.davidlau.org/why-the-wordpress-image-align-feature-was-not-working/

  • Digg
  • Technorati
  • del.icio.us
  • StumbleUpon
  • TwitThis
  • Sphinn
  • Facebook
  • LinkedIn
  • Google
  • YahooMyWeb
  • description
  • MisterWong
  • Live
  • 我挖网
  • QQ书签
  • 收客网
  • 百度搜藏
  • DigLog
  • 饭否
  • 365Key网摘
  • POCO网摘
  • 新浪ViVi

Here's A Few More Related Posts

RSS feed | Trackback URI

2 Comments »

2008-09-21 12:52:16
MyAvatars 0.2

[...] 转载http://www.davidlau.org/why-the-wordpress-image-align-feature-was-not-working/ [...]

 
Trackback by SIMPL if E
2008-11-07 02:06:16
MyAvatars 0.2

对着电脑一整天…

NYU-S这周进入Study Break,不用去本部上课,所以计划今天就写完《文心雕龙》的作业。早上背着电脑去图书馆,对着6本参考材料瞪眼。用了一个小时构思怎么写,最后选择放弃论文的方式,开….

 
Name (required)
E-mail (required - never shown publicly)
URI
Your Comment (smaller size | larger size)
You may use <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> in your comment.