Formating Preformated Text on Your Website Formating preformated النص على موقع الويب الخاص بك
August 6th, 2007 · by David Bradley السادس من آب / اغسطس 2007 من قبل ديفيد برادلي
On occasion, I have used the html <pre> tab to preformat an error message or other standout text in a post. في بعض الاحيان ، فقد استخدمت لغة تأشير النص الفائق <pre>على علامة تبويب قبل الصيغة رسالة خطأ او غيرها من standout نص في ما بعد. 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. واحد على الاقل هو مفتون sciencetext القارئ الى كيفية تمكنت من لف النص بدلا من ان يجري عرضها في جميع ارجاء المنطقة بعد او افقيه مع scrollbar.
Well, there is a very simple CSS hack. بالاضافة الى ذلك ، هناك بسيط جدا CSS المأجور. Open up your stylesheet (be sure to make a backup first) and add this code to the bottom. فتح stylesheet الخاص بك (التأكد من ان تكون احتياطية الاولى) ويضاف هذا القانون الى القاع.
/* Browser specific (not valid) styles to make preformatted text wrap */ / * متصفح محددة (غير صحيح) مهيأ مسبقا لجعل اساليب لف النص * /
pre { قبل (
white-space: pre-wrap; /* css-3 */ - الفضاء الابيض : مرحلة ما قبل الختاميه ؛ / CSS - 3 * * /
white-space: -moz-pre-wrap; /* Mozilla, since 1999 */ الابيض فضاء : - - MOZ ما قبل الختاميه ؛ / * موزيلا ، منذ عام 1999 * /
white-space: -pre-wrap; /* Opera 4-6 */ الابيض فضاء : - ما قبل الختاميه ؛ / 4-6 * * اوبرا /
white-space: -o-pre-wrap; /* Opera 7 */ الابيض فضاء : - س - ما قبل الختاميه ؛ / 7 * * اوبرا /
word-wrap: break-word; /* Internet Explorer 5.5+ */ - كلمة ختاميه : - كسر كلمة ؛ / انترنت اكسبلورر 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 صحيفة انقاذ وتحديث الصفحه التي كنت تستعمل preformated قسما من النص ، ينبغي ان تكون الآن افضل من الغلاف الجليدي ت. وهناك عدة طرق أخرى لتنفيذ هذا hack المأجور , but this is the quickest and easiest. ، ولكن هذا هو أسرع وأسهل. 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. يمكنك ايضا اضافة CSS علامات اخرى لتغيير حجم الخط ، على سبيل المثال ، حتى يتسنى للpreformated الجزء من النص حتى لا ينظر عالي الكعب. 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. وقد sciencetext stylesheet على سبيل المثال - ويشمل الخط الحجم : 0.9em ؛ للحد من حجم الخط الى 90 ٪ ، مما يجعل البحث اكثر قليلا انيق. You could add borders, change the font, in fact apply all kinds of special formating. انت يمكن ان تضيف الحدود ، وتغيير الخط في واقع الامر ينطبق على جميع انواع formating الخاصة. Just remember it will apply site wide to all pre text if you add the code to the stylesheet. فقط تذكر انها لن تطبق على نطاق واسع في الموقع الى ما قبل النص اذا كنت تضيف الشفره الى stylesheet.
Related Posts الوظائف ذات الصلة
- Formating Preformated Text on Your Website Formating preformated النص على موقع الويب الخاص بك
- Use Your Cellphone to Monitor Website Health استخدام الهاتف الجوال الخاص بك الموقع الالكترونى لرصد الصحة
- Are Your Error Pages Office2003blue? هي صفحات الخطأ office2003blue الخاصة بك؟
- Free Website Magazine موقع مجلة الحرة
- Who Hosts This Site من يستضيف هذا الموقع






















2 responses so far ↓ 2 الردود حتى الآن ↓
Hsien Lei ليأت hsien // / / Aug 9, 2007 at 10:31 am 9 آب / أغسطس ، 2007 في الساعة 10:31
I couldn’t access the Deleting Stubborn Files post and I have one I want to delete too! انا لا استطيع الوصول الى ما بعد حذف الملفات العنيده وانا واحد أريد ان احذف ايضا!
David Bradley ديفيد برادلي // / / Aug 9, 2007 at 12:07 pm 9 آب / أغسطس ، 2007 في الساعة 12:07
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… "حذف ملفات العنيده" ما بعد hsien يذكر ستظهر بشكل رسمى فى 10 اب / اغسطس ، انها حصلت قبل فترة ما بعد مؤرخة في هذا البند في الخطأ ، ولقد قمت بازاله ارتباط الآن…
Leave a Comment ترك التعليق