Good morning everyone,
I have an issue with FCKeditor outputting <p style="text-align: center"></p> when you want to center justify an image. In firefox, this will not center an image because text-align:center is for centering inline type elements, not block types (which images are). It works fine across the board for all other browsers, but not Firefox.
Is there another way to easily center images? And I don't mean sticking it in a table and centering the cell...I need a really simple way of centering an image in the editor so it will output propery in firefox.
My initial thoughts was to change how that justify center button works...so it outputs -moz-center...which correctly centers an image in firefox....but alas, it doesnt center an image in internet explorer.
My second thought it to go old school and modify it so it wraps <center></center> around the image. Depreciated, but works across all browsers & at this stage i'd rather have it working.
But I don't know how to go about making those changes to the code to make it output center tags instead of text-align styles. Is this even possible? Surely someone else has come across this problem before
Any help would be appreciated, cheers.
Thu, 07/31/2008 - 23:50
#1
Re: Firefox & Justify Center
Re: Firefox & Justify Center
You are mistaken - IMG is an inline element. See the HTML DTD:
http://www.w3.org/TR/html401/sgml/dtd.html
Search for <!ENTITY % inline and <!ENTITY % special. Check your CSS. Most likely you override the default with display: block somewhere.
Re: Firefox & Justify Center
I have been setting image to display:block for so long I starting to think it was a block element.
Thankyou for opening my eyes. All now works how I imaged. 3 cheers for A.M.