Prabhath - <code> is an inline element, so while is should probably be
included somewhere in marking up code, you need something else on the
outside of it to create the block. <pre> is semantically pretty sound
for this, since code is pre-formatted and some languages are
white-space sensitive, for example.

Vaska - Unfortunately there's nothing in the CSS2 spec that I know of
to do what you want (see:
http://www.w3.org/TR/REC-CSS2/text.html#white-space-prop). You can
either obey the white-space in the source code or automatically wrap
to the box, but not both.

The equivalent part of the CSS Level 3 spec is massively improved
though; providing additional white-space values and additional
properties for controlling individual parts of white-space handling.
"white-space" itself now effectively sets different combinations of
values for these new properties. I have no idea what
Opera/Firefox/Safari/K support is like for this yet, but I believe
that the text module is pretty stable spec wise, so expect some
implementations sooner rather than later, if not already. See:
http://www.w3.org/TR/css3-text/#white-space

If implementations do exist, you might be able to compromise your
design by using a CSS2 compatible white-space setting and overflow
scrolling for any long lines, then set the CSS3 value afterwards for
better handling in newer browsers as and when they support it.

Cheers,
Ben

On 5/31/05, Prabhath Sirisena <[EMAIL PROTECTED]> wrote:
> > I'm trying to make a page that will display some source code.  The PRE
> > tag works very will with retaining \t and \n but I can not find a way
> > to make it wrap words.  Words fly off the monitor...
> 
> Shouldn't you be using the code tag instead? It's a semantically better 
> option.
> 
> However, the problem will still remain.
> 
> Prabhath
> http://nidahas.com
> ******************************************************
> The discussion list for  http://webstandardsgroup.org/
> 
>  See http://webstandardsgroup.org/mail/guidelines.cfm
>  for some hints on posting to the list & getting help
> ******************************************************
> 
> 


-- 
http://www.ben-ward.co.uk
******************************************************
The discussion list for  http://webstandardsgroup.org/

 See http://webstandardsgroup.org/mail/guidelines.cfm
 for some hints on posting to the list & getting help
******************************************************

Reply via email to