Jump to content

white-space:pre help


Nadya

Recommended Posts

in my css file i have the followingbody {background-image: url(sand.jpg) }h1 {font-size: 20pt; text-align: center; }h2,h3,h4 {font-size: 15pt; text-align: left; text-decoration: underline; }.preElement{ white-space:pre; font-weight:bold; color:navy; font-family:arial;}the problem is that white-space:pre DOES NOT work? Anybody has an idea?

Link to comment
Share on other sites

It does, but it really depends on the content itself. white-space: pre makes it so that the result of

<div class="preElement">Some contenton more then one line</div>

Is rendered in the same way as

<pre>Some contenton more then one line</pre>

Would be.Apply that class to a non <pre> element that has a text that is on more then one line and you'll see what's the difference with and without it.

Link to comment
Share on other sites

The Result of <div class="preElement">Some co ntenton more then one line</div>

It does, but it really depends on the content itself. white-space: pre makes it so that the result of
<div class="preElement">Some contenton more then one line</div>

Is rendered in the same way as

<pre>Some contenton more then one line</pre>

Would be.Apply that class to a non <pre> element that has a text that is on more then one line and you'll see what's the difference with and without it.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...