Page 1 of 1

faking line break with CSS

Posted: Wed Jan 11, 2012 8:36 pm
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.

Re: faking line break with CSS

Posted: Thu Jan 12, 2012 10:58 am
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

Re: faking line break with CSS

Posted: Thu Jan 12, 2012 12:25 pm
by Vincent
It's working perfectly.

Thanks for the tip !


Vincent.