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 我的数字生活论坛 .



One Response to “How to Change the CSS Style, Font, Spacing, Alignment and Color of WordPress Image Captions” 1回应“如何改变CSS样式,字体,间距,对齐和颜色WordPress的图像字幕”

  1. Mark LaFlamme马克laflamme
    July 20th, 2008 10:05 2008年7月20日10时05分
    1

    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.我将添加标题我的第一篇文章显示。

Leave a Reply离开的答复

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong> 您可以使用这些标签:的<a href="" title=""> <abbr title=""> <acronym title="">的<b> <blockquote cite=""> <cite>的<code> <删除日期时间= “ ” >的<em>的<i> <q cite=""> <strike>的<strong>

Subscribe without commenting订阅无评论


Custom Search

New Articles新的条款,

Incoming Search Terms for the Article传入的搜索条件文章

css font-spacing CSS的字体间距 - - font-spacing css 字体间隔的CSS - - font-spacing 字体间距 - - css font spacing CSS的字体间距 - - change font code 更改字体代码 - - wp-caption 可湿性粉剂字幕 - - wp-caption css 可湿性粉剂字幕的CSS - - font spacing in css 字体间距在CSS - - css spacing CSS的间距 - - font spacing css 字体间距的CSS - - change font codes 变更字号守则 - - wp-caption style 可湿性粉剂字幕风格 - - how to change font spacing 如何改变字体间距 - - change css 改变的CSS - - wp-caption-text 可湿性粉剂字幕文本 - - wordpress 2.6 caption css 在WordPress 2.6标题的CSS - - css font align CSS的字体对齐 - - wordpress fonts 在WordPress字体 - - Change Text Style 变化文字样式 - - WP caption CSS 可湿性粉剂标题的CSS - - wordpress image caption css 在WordPress图片说明文字的CSS - - change font spacing 改变字体间距 - - photo gallery image change css 照片画廊的形象,改变的CSS - - css alignment CSS的路线 - - font align codes 字体对齐守则 - - css change font color CSS的改变字体颜色 - - changing font color css 改变字体颜色的CSS - - change font CSS 更改字体的CSS - - wordpress 图片样式 在WordPress图片样式 - - how to change image border colours in css 如何更改图像边界的颜色在CSS - - css aligntment CSS的aligntment - - font alignment 字体对齐 - - how to change text style in css 如何改变文本样式在CSS - - css style font CSS样式的字体 - - wordpress style caption 在WordPress作风标题 - - wordpress caption CSS 在WordPress标题的CSS - - css styling wordpress captions 的CSS风格的WordPress字幕 - - wordpress font color 在WordPress字体颜色 - - how to chang font styles in vista 如何常字型样式在Vista - - wordpress change css WordPress所改变的CSS - - css change font CSS的变更字号 - - image spacing css 形象间距的CSS - - m6 的M6 - - css style changer CSS样式换 - - css font color code CSS的字体颜色代码 - - how to change font and colour in photo comment titles 如何改变字体和颜色在照片评论的标题 - - change left aligned wordpress 改变左不结盟的WordPress - - change wordpress title font 改变的WordPress标题字体 - - how to change font css of div 如何改变字体的CSS的学 - - font css 字体的CSS - -