Home › Forums › Support › Image Caption Centered This topic has 7 replies, 2 voices, and was last updated 8 years, 4 months ago by Tom. Viewing 8 posts - 1 through 8 (of 8 total) Author Posts May 19, 2015 at 8:36 am #108896 Jack Heape What code should I use to center the caption on an image? I tried this… .wp-caption .wp-caption-text { padding: 8px 10px; margin: 0; text-align: center; background: url(‘images/blk_trans.png’); color:#FFF; position:absolute; bottom: 0; left: 0; } but it didn’t work. I read the post on the caption below an image, but all I want is for the text in the caption to be centered in the image, not aligned left. May 19, 2015 at 9:30 am #108912 TomLead Developer Lead Developer Give this CSS a try: .wp-caption .wp-caption-text { width: 100%; text-align: center; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; } May 19, 2015 at 9:44 am #108916 Jack Heape Worked great! Thanks. The caption is outside the image now but that is fine. May 19, 2015 at 12:13 pm #108970 TomLead Developer Lead Developer Hmm it shouldn’t be – can you link me to a page with it so I can see? May 19, 2015 at 12:46 pm #108993 Jack Heape http://divingservicecharleston.com May 19, 2015 at 3:15 pm #109010 TomLead Developer Lead Developer Did you perhaps replace the core styling (in your first post) with what I added above? All core CSS should be left alone – making changes to that stylesheet will result in you losing all of your modifications when you update WordPress. All custom CSS should go in a child theme or a custom CSS plugin: http://generatepress.com/knowledgebase/adding-css/ Let me know ๐ May 20, 2015 at 7:39 am #109123 Jack Heape Voila’! I used simple css and made all your suggested changes. Everything seems to be working fine now. Thanks! May 20, 2015 at 9:06 am #109140 TomLead Developer Lead Developer You’re welcome! ๐ Author Posts Viewing 8 posts - 1 through 8 (of 8 total) You must be logged in to reply to this topic. Log In Username: Password: Keep me signed in Log In