Image Shifted with ImageCaption Implemented

For discussion and questions related to CMS Specific templates and stylesheets (CSS), and themes. or layout issues. This is not a place for generic "I don't know CSS issues"
Post Reply
PBlue
Forum Members
Forum Members
Posts: 43
Joined: Tue Nov 07, 2006 5:54 am

Image Shifted with ImageCaption Implemented

Post by PBlue »

I found that after adding image caption, the image shifts out of the box and I cannot find any clue of where to change it:
Shift Image with Image Caption.png
My CMSMS version: 1.11.2

I followed the howto here: http://wiki.cmsmadesimple.org/index.php ... e_Captions
uniqu3

Re: Image Shifted with ImageCaption Implemented

Post by uniqu3 »

Without actually seeing your code/site (which would of been easier to answer) i guess that wrapping block (the white area) has a padding for example 10px or so set but image has same width as that box, this results that image is shifted to left.

Either make that box bigger or make image smaller.
PBlue
Forum Members
Forum Members
Posts: 43
Joined: Tue Nov 07, 2006 5:54 am

Re: Image Shifted with ImageCaption Implemented

Post by PBlue »

uniqu3 wrote:Without actually seeing your code/site (which would of been easier to answer) i guess that wrapping block (the white area) has a padding for example 10px or so set but image has same width as that box, this results that image is shifted to left.

Either make that box bigger or make image smaller.
I produced a testing site and you can see the shifted image from below link:
http://pilot.outsourcing.st/index.php?p ... ge-caption

The Image Caption is generated by a function and I don't know where is wrong. I guess maybe some CSS formatting in this theme is wrong and I don't know where. Thanks a lot for all the help!


Basic information of this site:
(1) Fresh install of cmsms 1.11.2
(2) Theme: G2:G2 downloaded from cmsms theme site

Let me know if you need more information.
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Image Shifted with ImageCaption Implemented

Post by Dr.CSS »

You may want to remove the <p>...

<p><img class="caption" src="uploads/images/advantage01.jpg" alt="Our Advantage" width="299" height="249" /></p>

<p><div style="width: 299px;" class="captionborder"><img class="caption" src="uploads/images/advantage01.jpg" alt="Our Advantage" height="249" width="299"><p class="captiontext">Our Advantage</p></div></p>

The CSS calls for 3px padding inside the captionborder...
uniqu3

Re: Image Shifted with ImageCaption Implemented

Post by uniqu3 »

Just like DrCss wrote captionborder has 3px padding, that is 299 (width of caption) + 6 (2x3px padding) + 2px (2x 1px border) makes 307px width

Which would require a image of 277px width

299px (caption inner width) - 2px (2x1px border) - 20px (2x10px margin) = 277px image width
PBlue
Forum Members
Forum Members
Posts: 43
Joined: Tue Nov 07, 2006 5:54 am

Re: Image Shifted with ImageCaption Implemented

Post by PBlue »

uniqu3 wrote:Just like DrCss wrote captionborder has 3px padding, that is 299 (width of caption) + 6 (2x3px padding) + 2px (2x 1px border) makes 307px width

Which would require a image of 277px width

299px (caption inner width) - 2px (2x1px border) - 20px (2x10px margin) = 277px image width
I changed the image size to 277px and the effect is the same - the image still shifted and below is the HTML code from TinyMCE:

<p><!-- Add code here that should appear in the content block of all new pages -->This is a test for Image Caption</p>
<p> </p>
<p><img class="caption" src="uploads/images/advantage01.jpg" alt="Our Advantage" width="277" height="231" /></p>

You can also view the effect from : http://pilot.outsourcing.st/index.php?p ... ge-caption

Maybe this is the bug from the CSS stylesheet? If I changed to other theme, the image is at the right place.
User avatar
Jo Morg
Dev Team Member
Dev Team Member
Posts: 1968
Joined: Mon Jan 29, 2007 4:47 pm

Re: Image Shifted with ImageCaption Implemented

Post by Jo Morg »

I would bet that both uniqu3 and DrCss are right so... you may have issues with your stylesheet. I just tested this with firebug and the following should work (it's a workaround not a solution):

Code: Select all

<div class="captionborder" style="width: 298px;"><img width="277" height="231" alt="Our Advantage" src="uploads/images/advantage01.jpg" class="caption"><p class="captiontext">Our Advantage</p></div>
*PS: this is pretty much what they said on their posts :D
"There are 10 types of people in this world, those who understand binary... and those who don't."
* by the way: English is NOT my native language (sorry for any mistakes...).
Code of Condut | CMSMS Docs | Help Support CMSMS
My developer Page on the Forge
GeekMoot 2015 in Ghent, Belgium: I was there!
GeekMoot 2016 in Leicester, UK: I was there!
DevMoot 2023 in Cynwyd, Wales: I was there!
User avatar
Dr.CSS
Moderator
Moderator
Posts: 12711
Joined: Thu Mar 09, 2006 5:32 am

Re: Image Shifted with ImageCaption Implemented

Post by Dr.CSS »

I think there is something in the plugin that is or can be set to make the outside box wider...
PBlue
Forum Members
Forum Members
Posts: 43
Joined: Tue Nov 07, 2006 5:54 am

Re: Image Shifted with ImageCaption Implemented

Post by PBlue »

Dr.CSS wrote:I think there is something in the plugin that is or can be set to make the outside box wider...
Thanks for all your help! As I am still at very junior level of dealing CSS Stylesheet, I think I'd better change to another theme.
Post Reply

Return to “Layout and Design (CSS & HTML)”