-
AuthorPosts
-
bookpeg Friend
bookpeg
- Join date:
- October 2008
- Posts:
- 419
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 82
- Thanked:
- 10 times in 1 posts
May 21, 2009 at 11:01 am #141356I upload a picture for the title of each article , but when i try to create spacing with the inbuilt insert/edit picture function within the articles top settings it doesnt show on the frontend…
could anyone explain?
bookpeg Friendbookpeg
- Join date:
- October 2008
- Posts:
- 419
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 82
- Thanked:
- 10 times in 1 posts
May 21, 2009 at 11:02 am #305372Sorry i posted twice by accident :S if a moderator sees this if you want remove np…
sorry againquestbg Friendquestbg
- Join date:
- May 2008
- Posts:
- 1912
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 146
- Thanked:
- 339 times in 197 posts
May 22, 2009 at 4:58 am #305458Hi Bookpeg
Make sure you’ve got ‘caption’ class assigned, otherwise the spacing function doesn’t work.
When you import a picture, tick the ‘caption’ box. Even if you don’t want a caption!
(if you don’t want a caption, just leave the ‘Title’ field empty)
Hope that works!
Chris
bookpeg Friendbookpeg
- Join date:
- October 2008
- Posts:
- 419
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 82
- Thanked:
- 10 times in 1 posts
May 22, 2009 at 6:56 am #305463Great that worked — excellent thankyou!
questbg Friendquestbg
- Join date:
- May 2008
- Posts:
- 1912
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 146
- Thanked:
- 339 times in 197 posts
May 22, 2009 at 7:41 am #305482Glad to hear it worked! Took me awhile to figure it out too 😀
codger Friendcodger
- Join date:
- July 2008
- Posts:
- 90
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 18
- Thanked:
- 4 times in 1 posts
May 25, 2009 at 6:12 pm #305846While we are on the subject, has anyone worked out how to edit this so that (for instance) the border is outset to create a “frame” effect, or even just to increase the whitespace around an image?
joeflynn Friendjoeflynn
- Join date:
- February 2009
- Posts:
- 91
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 59
- Thanked:
- 3 times in 1 posts
May 26, 2009 at 8:18 am #305883Yes, especially white space to the right of the image…so that the text doesn’t butt up against the picture…
Thankscodger Friendcodger
- Join date:
- July 2008
- Posts:
- 90
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 18
- Thanked:
- 4 times in 1 posts
May 26, 2009 at 3:20 pm #305899Well joeflynn, as guest bg has already pointed out, you need to select the “caption” class to get a left (or right) margin – and I have just found out how to control the amount of whitespace around the image. Although I use Teline II, it was with my current work with Rochea that I needed this. I found the solution in the Beez template.css and adapted it to Rochea. I have not tried it in Teline II, but it may well work for you. The code I used in Rochea is below – you can adapt it to suit your needs.
/* Caption fixes */
.img_caption.left {
float: left;
margin-right: 2em;
}.img_caption.right {
float: right;
margin-left: 2em;
}.img_caption.left p {
clear: left;
text-align: center;
}.img_caption.right p {
clear: right;
text-align: center;
}
I also experimented with all-round padding to create the amount of air that you need round the image. It works a treat! (In Rochea, anyway.) 😉Anyone who tries this, please let us know how you get on.
1 user says Thank You to codger for this useful post
joeflynn Friendjoeflynn
- Join date:
- February 2009
- Posts:
- 91
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 59
- Thanked:
- 3 times in 1 posts
May 26, 2009 at 6:03 pm #305904Wow~! That’s exactly the code I needed. I might change it to 1em, but the change is the thing.
Many thanks. You can see it here. The picture used to sit right next to the text. http://altenergytools.com/index.php?option=com_content&view=article&id=128:50-percent-more-power-output&catid=59:industrial&Itemid=183
scotty Friendscotty
- Join date:
- March 2008
- Posts:
- 2339
- Downloads:
- 0
- Uploads:
- 13
- Thanks:
- 76
- Thanked:
- 827 times in 595 posts
May 26, 2009 at 10:56 pm #305920Hi folks, let me explain what’s going on here.
In line 75 of your template.css you’ll find…
img {
margin:0;
padding:0;
}
This will override any hspace or vspace you added to the image via the editor and this is why if you do not use ‘caption’ there is no space applied.Using caption is not really the best thing to do as caption is a very special class in Joomla. It’s actually a plugin. It takes the Title tag and uses it to apply the caption under your image. This adds extra load to your page (not much though tbh).
The correct way to fix this would be to add a new style to your template.css that is specifically for images inside articles. For example…
.article-content img {
margin:0 10px;
}
…will add a 10px margin to just the left and right sides of your images. You do not need to apply a class as it will do it to all images inside articles (that don’t have a specific class already applied) automatically.You could also use specific classes for left or right aligned images…
/* Use class="left" */
.left {
float: left;
margin-right: 10px;
}/* Use class="right" */
.right {
float: right;
margin-left: 10px;
}
If you want to add a small white border….
.border {
border: 1px solid #333333 !important;
padding: 3px;
background: #FFFFFF;
}
You can then combine these classes like…
<img class=”left border” height=”230″ width=”290″ title=”Sample image” alt=”Sample image” src=”images/stories/demo/sample.jpg”/>NOTE: TinyMCE adds border=”0″ by default and that’s why we add !important above.Hope this helps clear up some of the confusion. 🙂
1 user says Thank You to scotty for this useful post
codger Friendcodger
- Join date:
- July 2008
- Posts:
- 90
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 18
- Thanked:
- 4 times in 1 posts
May 27, 2009 at 7:54 am #305932Good stuff, scotty.
The “caption” rule is applied to the containing div and the image itself can be styled separately. So for those of us using “caption” only one rule is required to make a border. In my Rochea project I settled on.img_caption img {
padding: 5px;
border: 1px solid #cccccc !important;
}but as always, you can tweak the detail to suit the requirements of your site.
joeflynn Friendjoeflynn
- Join date:
- February 2009
- Posts:
- 91
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 59
- Thanked:
- 3 times in 1 posts
May 27, 2009 at 10:37 am #305942I just put the three bits that Scotty specified into the template.css (at line 80) and it works mighty fine without the caption being hit. For me, that is one less thing to remember to click.
Here’s what I used, thought I will probably tweak it to 5. Following that is a link to a page that is using it. Again, many thanks to all.
.article-content img {
margin:0 5px;
}/* Use class=”left” */
.left img {
float: left;
margin-right: 5px;
}/* Use class=”right” */
.right img {
float: right;
margin-left: 5px;
}bookpeg Friendbookpeg
- Join date:
- October 2008
- Posts:
- 419
- Downloads:
- 0
- Uploads:
- 1
- Thanks:
- 82
- Thanked:
- 10 times in 1 posts
June 5, 2009 at 11:00 am #307032Could you explain why it doesnt work in i.e
it does work in firefox but not i.e?
codger Friendcodger
- Join date:
- July 2008
- Posts:
- 90
- Downloads:
- 0
- Uploads:
- 3
- Thanks:
- 18
- Thanked:
- 4 times in 1 posts
June 5, 2009 at 2:32 pm #307049The only ie I bother to test in these days is IE6.
Fwiw, using caption with my ccs above, the margin is doubled in that browser. The webkit browsers Safari and Chrome as well as Opera all display my Rochea project as intended. -
AuthorPosts
This topic contains 16 replies, has 6 voices, and was last updated by theprofessor 15 years, 5 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum