Hello,
I've installed wysiwyg image upload module 6.x-2.3 and it works as expected with TinyMCE.
However I'm not able to center images in text. I tried to create a new style in imgupload.css like
.imgupl_floating_none_center
{
display:block;
margin-left:auto;
margin-right:auto;
}
and modified wysiwyg_imageupload.form to show the style in alignment selection box.
In TinyMCE the image is then centered but when I save the work the image is left aligned again.
Is there a way to center images in articles?
Comments
Comment #1
eugenmayer commentedyou might need to have a look at the theming for the "node view". Probably the styles having problems with the boxes we need to fix then. Just have a look with firebug / any css explorer and see why the image is not centered. in general your approach is perfectly right and should work out.
the difference between the WYSIWYG representation of the image is, that in the WYS.. its only
while in the node view its surrounded by wrapper for meta data, capations etc. Thats where we could have issue.
Comment #2
Birgerkung commentedOk, figured it out.
I had to add:
text-align:center;
to the new style and now it works.
Thanks.
Comment #3
lazerus2000 commentedGot the same problem but adding text-align:center; doesn't solve it for me!
Code:
img.imgupl_styles_zentrieren
{
display:block;
margin-left:auto;
margin-right:auto;
text-align:center;
}
I'm using the st.alphorn theme and all Images are aligned left. Margin-left:60px works, but "auto" is doing nothing. Is there a solution? Why there is no "center image" CSS-class included?
Thanks for your help!
Comment #4
eugenmayer commentedand that still stays fixed :)
Comment #5
lazerus2000 commentedThat was a great help! So it would have been better to create a new post with the same problem?