CSS display block and line break

Having trouble installing Oxygen? Got a bug to report? Post it all here.
Vincent
Posts: 52
Joined: Thu Dec 15, 2011 7:56 pm

CSS display block and line break

Post 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.
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: CSS display block and line break

Post 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
Mihaela Calotescu
http://www.oxygenxml.com
Vincent
Posts: 52
Joined: Thu Dec 15, 2011 7:56 pm

Re: CSS display block and line break

Post 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.
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: CSS display block and line break

Post 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
Mihaela Calotescu
http://www.oxygenxml.com
Vincent
Posts: 52
Joined: Thu Dec 15, 2011 7:56 pm

Re: CSS display block and line break

Post 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.
Post Reply