How to Change the CSS Style, Font, Spacing, Alignment and Color of WordPress Image Captions如何改变CSS样式,字体,间距,对齐和颜色WordPress的图像字幕
Since WordPress由于在WordPress version 2.6 2.6版 , WordPress has added a built-in shortcode, “Caption”, which will be automatically rendered and translated into standard HTML CSS code to display the caption for the photo or image, which saved via media uploader, beneath it. ,在WordPress增添了一个内置在短, “说明” ,系统会自动提供并翻译成标准的HTML的CSS代码以显示标题的照片或图片,节省经媒体上载器,它的下方。
However, when WordPress appends the DIV styles to print the caption title under the picture or image, WordPress makes use of default alignment, color, font, spacing, and other styling attributes to display the image captions.然而,当在WordPress附加学作风,打印字幕的标题下,图片或影像, WordPress所使用的预设路线,颜色,字体,间距,和其他的风格属性,以显示图像字幕。
The default CSS styles for image with the caption may potentially breaks the blog or web page layout, does not validate against W3C xHTML standard, appears too closely with the text with no spacing in the post or page, or does not align as author’s wish.默认的CSS样式的形象与说明可能爆发的博客或网页的布局,不验证的XHTML对W3C的标准,似乎太密切与文本没有间隔,在后或网页,或不作为,使作者的愿望。
For blogger who wants to modify the CSS styles of the caption that shows the image captions on screen after parsing the shortcode, add the following CSS code into the active theme’s style.css file:对Blogger谁要修改的CSS风格的字幕显示的图像字幕在屏幕上后,解析短,添加以下的CSS代码并将积极为主题的style.css档案:
/* Captions */ / *标题* /
.aligncenter, 。 aligncenter ,
div.aligncenter { div.aligncenter (
display: block; 显示:座;
margin-left: auto; 保证金左:自动;
margin-right: auto; 保证金-右:自动;
} )
.wp-caption { 。可湿性粉剂字幕(
border: 1px solid #ddd; 边界: 1px固体#国内长途;
text-align: center; 文本对齐:中心;
background-color: #f3f3f3; 背景颜色: # f3f3f3 ;
padding-top: 4px; 填充顶: 4px ;
margin: 10px; 保证金: 10px ;
-moz-border-radius: 3px; -万盎司边界半径: 3px ;
-khtml-border-radius: 3px; - khtml边界半径: 3px ;
-webkit-border-radius: 3px; - webkit边界半径: 3px ;
border-radius: 3px; 边界半径: 3px ;
} )
.wp-caption img { 。可湿性粉剂字幕国际管理集团(
margin: 0; 保证金: 0 ;
padding: 0; 填充: 0 ;
border: 0 none; 边界: 0无;
} )
.wp-caption p.wp-caption-text { 。可湿性粉剂字幕p.wp字幕文本(
font-size: 11px; 字体大小: 11px ;
line-height: 17px; 线高度: 17px ;
padding: 0 4px 5px; 填充: 0 4px 5px ;
margin: 0; 保证金: 0 ;
} )
/* End captions */ / *结束字幕* /
Above HTML CSS declaration is taken from WordPress 2.6 default theme.上述的HTML的CSS声明是采取从在WordPress 2.6默认的主题。 These newly added CSS styles are used to control and assign the appearance of the caption for the image posted on blog.这些新增的CSS样式是用来控制和分配的外观标题的形象,张贴于博客。 Modify the code above in “style.css” file according to your own preference to have your own design and look.修改上面的代码在“ style.css ”文件根据自己的喜好有自己的设计和研究。
IMPORTANT : This is a machine translated page which is provided "as is" without warranty. 重要说明 :这是一个机器翻译网页是“按原样”提供的担保。 Machine translation may be difficult to understand.机器翻译可能很难理解。 Please refer to请参阅 original English article英文原版的文章 whenever possible.只要有可能。
Share and contribute or get technical support and help at分享和贡献,或取得技术的支持和帮助,在 My Digital Life Forums 我的数字生活论坛 . 。
Related Articles相关文章
- How to Disable Image and Video Captions Feature and Auto Adding of Shortcode in WordPress 2.6如何禁用图片和视频字幕功能和自动加入的短在WordPress 2.6
- Switch and Change Back to Office 2003 Default Font and Style Set in Office Word 2007开关和改变回Office 2003的默认字体和风格设置在Office Word 2007中
- Meaning of TVAnts Buffer Progress Bar Colors含义tvants缓冲进度栏的颜色
- WordPress 2.6 with Change Revision Tracking Feature Available for Free Download在WordPress 2.6与变化修订跟踪功能,提供免费下载
- How to Change the Frequency or Interval WordPress Auto Saves An Editing Post or Page如何改变频率或间隔的WordPress自动保存编辑的职位或网页
- Website Loading Time and Speed Checker网站加载时间和速度检查
- Remove Microsoft Word Manual Formatting or Copied Formatting from External Source删除Microsoft Word的手册格式或复制格式从外部来源
- Permanently Disable AdSense-Deluxe WordPress Plugin Reward Plugin Author Option永久禁用的AdSense豪华wordpress插件奖励插件作者的选择
- Search Engine Spider and Crawler Simulator搜索引擎蜘蛛和履带式模拟器
- Disable and Turn Off Post Revisions Tracking in WordPress 2.6 or Above禁用和关闭后的修改,跟踪在WordPress 2.6或以上
















July 20th, 2008 10:05 2008年7月20日10时05分
For the life of me, I cannot get captions to work.为生活,我不能字幕工作。 It looks great in preview, but live, all the code spills out around the photo and there’s no caption at all.看来,伟大的预览,但生活,所有代码泄漏围绕照片,并没有说明在所有。 I added the caption code to my theme’s style.css but there was no change.我已将标题代码我主题的style.css ,但并没有改变。 Seems like I’m just one minor step away from making this work.好像我只是一个小步骤,远离决策这方面的工作。 If anyone has any ideas, I’d love to hear them.如果任何人有任何想法,我喜欢听到他们。 I’ll add a caption to my first post to demonstrate.我将添加标题我的第一篇文章显示。