views:

240

answers:

4

I'm new to CSS and I want to minimize the amount of tagging I am doing in an HTML document.

Is there a way to define newlines as having <br /> so that for a given <div> that I've defined I can do the following:

.description {
        br: on;
    color: #D3E22A;
    width: wrap; 
}
+1  A: 
white-space: pre;

this makes it just like a <pre> element.

sakabako
this is precisely what i wanted to do.thanks.jml
jml
+3  A: 
white-space: pre;

or

white-space: pre-wrap;

See the specs.

Michael Krelin - hacker
great; thanks for the info!
jml
A: 

Well , if you have a text an you nave a new-line, it means , that you have began a new paragraph - a <p> tag. Try reading this article : http://brainstormsandraves.com/articles/semantics/structure/

Basicly that, what you call a "newline", is caused by a begining of a new block level element. A paragraph is a block level element. And for all block-level element you can set a verticla margins and paddings.

Recommended readoing: - http://www.htmldog.com/guides/ - http://wsc.opera.com/

azazul
+1  A: 

It sounds like you want a tool to allow you to enter text in paragraph form without needing to write your own markup for it. You probably want a WYSIWYG editor. There are free JavaScript implementations that offer nice input formatting tools.

You definitely don't want to insert
tags with CSS - that is just nonsense. CSS defines formatting for markup. It doesn't create new markup.

If you want to apply some sort of markup transformation, use JavaScript or a server-side scripting language. CSS is not a general-purpose programming language.

Will Bickford