You are here: Re: WIDTH attribute for peformatted text « HTML « IT news, forums, messages
Re: WIDTH attribute for peformatted text

Posted by Adam Pflug on 10/01/05 12:32

I dont exactly know what you want to do here, if you are just looking
to make it so that the pre forces a line wrap (at least if the line can
be wrapped) after a certain number of characters you can do it with an
entry on your stylesheet. Unfortunately you cannot use the "pre" tag
because the disables word wrapping, however unless you need whitespace
preserved (which is what the pre tag is supposed to be used for) then
you can duplicate the effect you want with the following css code:

..code
{
font-family: courier, monospace;
width: ###em;
}

Where ### is the number of characters to be allowed on a line.
If you want to dynamically figure out how many characters to allow on a
line just do this:

..code
{
font-family: courier, monospace;
width: 100%;
}

The html block would look like this:
<div class="code">This is some code</div>
Dont forget to use &lt; and &gt; instead of < and >

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация