CSS line breaks
Posted: Mon Dec 08, 2008 10:39 pm
Hello all, I was curious to know if there is a way to NOT ignore line breaks in an element. As you all know HTML by default ignores line breaks(\n characters), but is there a way through CSS to specify that the element WILL break on the newline characters? For example:
HTML:
CSS:
RESULT:
Thanks for reading. I hope there's such a CSS property.
HTML:
Code: Select all
<p class="prelines">
This text preserves newline characters and nothing else like
tabs or more then one space characters.
</p>
Code: Select all
.preline {
some-rule-that-preserves-newline-characters: value;
}
What I'm looking for is the some-rule-that-preserves-newline-characters rule. I know I could use the white-space property but I believe this preserves tabs and multiple space characters as well(which is not what I want).This text preserves newline characters and nothing else like
tabs or more then one space characters.
Thanks for reading. I hope there's such a CSS property.