Formating Preformated Text on Your Website Formating Preformated texto no seu site
August 6th, 2007 · by David Bradley 6 de agosto de 2007 por David Bradley
On occasion, I have used the html <pre> tab to preformat an error message or other standout text in a post. De vez em quando, tenho usado o html <pre> guia para preformat uma mensagem de erro ou de outros standout texto em um post. At least one Sciencetext reader was intrigued as to how I managed to wrap the text rather than it being displayed right across the post area or with a horizontal scrollbar. Pelo menos um leitor Sciencetext intrigado quanto à forma como foi gerida me para embrulhar o texto não sendo exibidos em toda a área ou a um posto barra horizontal.
Well, there is a very simple CSS hack. Pois bem, há um truque muito simples CSS. Open up your stylesheet (be sure to make a backup first) and add this code to the bottom. Abra o seu estilo (não se esqueça de fazer um backup antes) e adicionar esse código para o fundo.
/* Browser specific (not valid) styles to make preformatted text wrap */ / * Browser específico (não é válido) estilos de fazer pré embrulhar texto * /
pre { pré (
white-space: pre-wrap; /* css-3 */ white-space: pré-embrulhar; / * css-3 * /
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ branco-espaço:-moz-pré-embrulhar; / * Mozilla, desde 1999 * /
white-space: -pre-wrap; /* Opera 4-6 */ branco-espaço:-pré-embrulhar; / * Opera 4-6 * /
white-space: -o-pre-wrap; /* Opera 7 */ branco-espaço:-o-pré-embrulhar; / * Opera 7 * /
word-wrap: break-word; /* Internet Explorer 5.5+ */ a mudança de linha: break-word; / * Internet Explorer 5.5 + * /
} )
Save the sheet and refresh the page on which you are using the preformated chunk of text, it should now be wrapping better than Ice T. There are various other ways to implement this Salve a folha e atualizar a página em que você está usando a preformated pedaço de texto, que deve agora ser melhor do que o embrulho Ice T. Existem várias outras maneiras de implementar este hack , but this is the quickest and easiest. , Mas este é o mais rápido e mais fácil. You can also add other CSS tags to change the font size, for instance, so that the preformated block of text doesn’t look so clunky. Você também pode adicionar outros CSS tags para alterar o tamanho das letras, por exemplo, a fim de que o preformated bloco de texto que não fica tão clunky. The Sciencetext stylesheet for instance includes font-size:0.9em; to reduce the font size to 90%, which makes it look a little more stylish. O estilo Sciencetext por exemplo inclui font-size: 0.9em; para reduzir o tamanho da fonte para 90%, o que torna olhar um pouco mais elegante. You could add borders, change the font, in fact apply all kinds of special formating. Você poderia adicionar fronteiras, alterar a fonte, na verdade se aplicam todos os tipos de formatação especial. Just remember it will apply site wide to all pre text if you add the code to the stylesheet. Basta lembrar que será aplicável a todos os pré site vasta texto se você adicionar o código para a folha de estilo.
Related Posts Posts relacionados
- Formating Preformated Text on Your Website Formating Preformated texto no seu site
- Use Your Cellphone to Monitor Website Health Use seu celular para acompanhar site da Saúde
- Are Your Error Pages Office2003blue? São as suas páginas Office2003blue erro?
- Free Website Magazine Free Website Magazine
- Who Hosts This Site Este site que hospeda






















2 responses so far ↓ 2 respostas até agora ↓
Hsien Lei Lei Hsien // / / Aug 9, 2007 at 10:31 am 9 de Agosto de 2007 em 10:31 am
I couldn’t access the Deleting Stubborn Files post and I have one I want to delete too! Eu não poderia aceder a ficheiros Excluindo teimoso e tenho um post que quero apagar também!
David Bradley David Bradley // / / Aug 9, 2007 at 12:07 pm 9 de Agosto de 2007 em 12:07 pm
The “deleting stubborn files” post Hsien mentions will appear formally on Aug 10, it got pre-post-dated in this item in error, I’ve removed the link for now… O "apagar arquivos teimosos" pós Hsien menciona aparecerá formalmente em 10 de agosto, ela obteve pré-pós-datados, neste item em erro, eu tiver removido o link para já…
Leave a Comment Deixe um comentário