Wordpress Themes - WP Forum at BFA
There will be no more development for Atahualpa (or any other theme), and no support. Also no new registrations. I turned off the donation system. I may turn the forum to read only if it gets abused for spam. Unfortunately I have no time for the forum or the themes. Thanks a lot to the people who helped in all these years, especially Larry and of course: Paul. Take care and stay healthy -- Flynn, Atahualpa developer, Sep 2021

Wordpress Themes - WP Forum at BFA » WordPress Themes » Atahualpa 3 Wordpress theme » Center area post/pages »

Strange border around images with captions


  #1  
Old Mar 2, 2010, 02:45 PM
Androsko
 
4 posts · Nov 2009
I'm having a weird issue with styling, and I'm at a loss with how to fix it. I've been revamping my personal site lately with Atahualpa (which I've used to build three sites now, awesome theme), and I'm stuck on a problem with captioned images. When I give an image a caption, it adds about 5px on either side of the image with the background color of the caption, as if the div is to wide for the image. I've been over it dozens of times in Firebug, but I can't seem to figure out the culprit. I put up a test post showing my problem here. I changed the background color to red to highlight the problem:

http://www.androsko.com/post/test-post-2

The problem is not present on captionless images like this one:

http://www.androsko.com/post/test-post-1

What I'd like is to get rid of the padding on the left and right of the image so that the caption box is also the same width as the image above it. Everything else is the way I want it except that, and I have no idea where it's coming from. The only thing I found was an element.style that was setting the width to 210px (the image in test post 2 is 200px wide), but I'm not sure how to work around that. Any help would be much appreciated, as I'd love to use captions but I hate that padding.

My specs:
Wordpress 2.9.2
Atahualpa 3.4.6 (I've been having this issue at least since 3.4.4)
  #2  
Old Mar 2, 2010, 03:15 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
In "ATO>Style IMAGES>Images in Posts: Caption Style" make sure there is a
HTML Code:
padding-top: 4px;
It should be there by default. I was able to get your caption border to work with the following in Firebug so I should work in CSS Inserts
HTML Code:
.wp-caption {padding-top:4px;}
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #3  
Old Mar 2, 2010, 03:43 PM
Androsko
 
4 posts · Nov 2009
Hi Larry,

Thanks for the reply. Unfortunately, what I'm trying to do is get rid of the padding entirely. Adding 4px on the top evens out the top with the rest of the border, but I don't want to have any border at all. I'd like to have similar padding as my regular images in Test Post 1, just with the caption underneath. So far everything I try leaves that padding on the left and right. I must be missing something obvious, but I can't figure out what's causing that left and right padding to appear. Otherwise I'd fix it with an insert.

So briefly what I'm looking for is a captioned image that has no padding around the image and uses the same margin styles as my non-captioned images, so the red currently on the left and right would be gone and the red underneath would be the same width as the image.

Thanks,
Androsko
  #4  
Old Mar 2, 2010, 04:25 PM
lmilesw's Avatar
lmilesw
 
10,176 posts · Jul 2009
Central New York State USA
You could try this
HTML Code:
.wp-caption {width:200px !important;}
__________________
~Larry (CNY Web Designs)
This site should be a membership site since it so full of good stuff.
Please consider donating which gives you access to even more good stuff.
  #5  
Old Mar 2, 2010, 10:41 PM
Androsko
 
4 posts · Nov 2009
That worked well for the one image that is 200px wide, but I'm looking for something that will work for all images with captions regardless of width. It did give me an idea though, and after poking around with various solutions, I'm about 90% there:

HTML Code:
.wp-caption 
{
width:auto !important;
height:auto !important;
}
I've tested that insert as working in IE8, Firefox and Chrome. I'm worried that it won't work in IE6 with the !important declarations, but that'll be another day's work. As I suspected the DIV is the problem. Something is adding 5px on the left and right, but I can't tell what. This insert sets the DIV width and height to auto, essentially wrapping itself to the image inside as you can see:

http://www.androsko.com/post/test-post-2

The big problem with this solution is that it messes up the line breaks for the caption text. There is nothing giving the <p> any width style, so it keeps going beyond the image as you can see here:

http://www.androsko.com/post/test-post-3

I tried adding inserts for auto and inherit width to the "div.wp-caption p" with no luck. I can insert manual breaks with <br />, but that's not a very elegant solution. Anyone have thoughts on setting the width for the caption text relative to the image width in the DIV?

So that mostly takes care of the problem, but... What on earth is adding that 5px on the left and right!?! Seriously, I can't find what's causing it. If I could, I would get rid of it and that would be the end of the problem.

Bookmarks

Tags
border, caption, image, margin, padding



Similar Threads
Thread Thread Starter Forum Replies Last Post
Style Container border with images gcarson Header configuration & styling 1 Dec 30, 2009 12:36 PM
Links in image captions paulae Atahualpa 3 Wordpress theme 1 Jul 16, 2009 09:01 AM
How to display page excerpts and images on sidebar (or, strange widget behaviour) reallylost Sidebars & Widgets 5 Jun 4, 2009 08:27 AM
how to add border to sidebar images? Riin Sidebars & Widgets 3 May 16, 2009 01:19 PM
Captions won't show under image vka2b Atahualpa 3 Wordpress theme 0 Mar 24, 2009 09:01 PM


All times are GMT -6. The time now is 12:03 PM.


Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.