Page 1 of 1

CSS display block and line break

Posted: Mon Dec 19, 2011 8:23 pm
by Vincent
Hi,

I use a CSS stylesheet for the Author mode.
When I specify a CSS display:block property to an element, I get line breaks.

One before and one after the block. It's not a margin or padding problem because they are all set to 0.

I suspect the XML indentation... because when I delete (manualy) the indentation between this element and its parent. There's no line breaks any more...

Exemple (copy/paste) :

Code: Select all

                     <Comment>
<par>text...</par>
</Comment>
Is it a known issue ?

Thanks,
Vincent.

Re: CSS display block and line break

Posted: Tue Dec 20, 2011 5:31 pm
by mihaela
Hi Vincent,

The line breaks appears in Author mode, right?
I understand that you have the CSS display:block property set for par element. What is the display property value for its Comment parent element (inline or block)?

Regards,
Mihaela

Re: CSS display block and line break

Posted: Tue Dec 20, 2011 7:17 pm
by Vincent
Exactly, it appears in the Author Mode.

The parent element is also with CSS display:block property.
But I've tried with inline, inline-block, and without the property... it's still the same.


If I delete manually the indentation in Text mode to get something like that :

Code: Select all

<Comment><par>text...</par></Comment>
The line breaks disapear... !

Is it possible to add/delete easily the indentation ?
I mean, a button or something which can switch between with or without indentation in my xml file.

Thanks a lot Mihaela !
Vincent.

Re: CSS display block and line break

Posted: Wed Dec 21, 2011 11:28 am
by mihaela
Hi Vincent,

I suspect that the Comment element is a space-preserve element. In this case all the white spaces are presented in its content, in Author mode.

You can check if the element has a space-preserve content by pressing ENTER inside the element content. If the content completion menu contains the ENTER (line break) entry means that the element is a space-preserve one.

The element can be declared as space-preserve in the associated CSS (if the white-space property has pre value) or in the document schema (you can check the Model view to see the Whitespace property value). Also, an element can be declared as preserve space in Preferences -> "Editor / Format / XML", "Elements Spacing" section.

In case this is not the cause of the line breaks, it could be useful if you could send us (support@oxygenxml.com) an XML sample that reproduces your problem (together with the associated CSS/schema).


Best regards,
Mihaela

Re: CSS display block and line break

Posted: Wed Jan 11, 2012 8:23 pm
by Vincent
Hi Mihaela,

I wish you an happy new year (you and all of your team!).
I was off but now I'm back on this project.

This bug has been fixed today ! ... very easily...
By pressing "the format and indent" button (Ctrl+Shift+I) in Text Mode.

I'm sorry not to have tried this earlier !

Thanks a lot for your support.

Vincent.