faking line break with CSS

Oxygen general issues.
Vincent
Posts: 52
Joined: Thu Dec 15, 2011 7:56 pm

faking line break with CSS

Post by Vincent »

Hi,

I have a particular case where my node include an "<l/>" element which is suppose to mean "Line Break" later in the next of the process.

Code: Select all


<element>First line<l/>Seconde line</element>
I tried to select it by CSS and put as content the entity carriage return "& #13;" (without space). But it doesn't do it!
Then I tried to "display:block" this element but there a space between my two lines (like between two paragraphs) and un don't want it...

An idea to put a linebreak instead of this element only with CSS ?

Thank you,
Vincent.
mihaela
Posts: 490
Joined: Wed May 20, 2009 2:40 pm

Re: faking line break with CSS

Post by mihaela »

Hi Vincent,

You can use the second solution: set "display:block" for the line break element. In addition, to get rid of the space between the two lines you have to set an empty content on before pseudo-element:

Code: Select all


l {
display: block;
}

l:before {
content: "";
}
Best Regards,
Mihaela
Mihaela Calotescu
http://www.oxygenxml.com
Vincent
Posts: 52
Joined: Thu Dec 15, 2011 7:56 pm

Re: faking line break with CSS

Post by Vincent »

It's working perfectly.

Thanks for the tip !


Vincent.
Post Reply