Pragmatism in code


Waxing lyrical about life the universe and everything tech related since lunchtime 2006.
1 minute reading time (281 words)

Fixing the paragraph spacing issue

You may have noticed that after neatly setting out your post within the TinyMCE editor, when the page is published, the paragraphs are all squashed up.

The issue is a CSS issue. Basically the style applied to the P tag by TinyMCE and D7 are different - so it displays OK in the editor, but when the D7 code renders it - it is displayed differently.

The offending code is in templates/base/css/general.css, the attribute margin:0px is applied to the P tag, remove this and the issue will be gone, BUT there is one caveat - obviously this affects ALL instances of the P tag - so it may be that whilst this cures the immediate issue, it may cause problems elsewhere (i've not tested this, and this may be different for your site - depending on which template you use and what modifications you have applied to them)

To fix the issue, you will need to change general.css in two places -

Line 1



a img, form, p



a img, form

and on line 120





There is no real need to apply the attributes to the P as has been done in the original code, plus declaring the base P tag in two different places can lead to inheritance issues.

If it turns out that removing these elements has too much of a knock on effect on other areas of the site, then The best solution may be to alter the TinyMCE css to match the D7 general by adding the margin:0px to plugins/tiny_mce/themes/advanced/skins/default/content.css At least then what you see will actually be what you get

Times a Changing
New Look for DeeEmm

Related Posts



No comments made yet. Be the first to submit a comment
Already Registered? Login Here
Thursday, 02 July 2020
If you'd like to register, please fill in the username, password and name fields.

Captcha Image