نسق كود HTML بإزاحة تراعي العناصر الكتلية، أو اضغطه. يتم الحفاظ على محتويات pre وtextarea وscript وstyle.
كيفية استخدام منسق HTML
الصق كود HTML في صندوق الإدخال.
اختر التنسيق لإضافة الإزاحة أو الضغط لتقليصه.
اختر حجم الإزاحة، ثم انسخ النتيجة.
This is an HTML formatter that beautifies markup with block and inline aware indentation, or minifies it by collapsing whitespace and stripping comments. You pick the indent size when beautifying.
Beautifying indents elements according to how they nest, so the structure of a document, which elements contain which, becomes obvious. That makes hand-written or generated HTML far easier to read and debug.
Both beautify and minify run entirely in your browser, so your markup never leaves your device.
It deliberately leaves the contents of pre, textarea, script and style untouched, because whitespace inside those elements is significant: reformatting them would change preformatted text, what users type, or the meaning of your code.
Minifying removes comments and collapses runs of whitespace, which trims the file size browsers have to download. It is most useful as a build step for production pages.
The minifier keeps a single space between tags rather than removing it entirely, because whitespace between inline elements is actually rendered, and dropping it can shift your layout. This caution avoids the subtle visual bugs aggressive minifiers can cause.
الأسئلة الشائعة
يضيف إزاحة للعناصر بناء على تداخلها وبنيتها، مع ترك محتويات pre وtextarea وscript وstyle دون تغيير، لأن المسافات البيضاء فيها ذات أهمية.
يزيل التعليقات ويضغط تتابعات المسافات البيضاء إلى مسافة واحدة. ويبقي على مسافات مفردة بين الوسوم بدلا من إزالتها، لأن المسافات بين العناصر السطرية تظهر في العرض وإزالتها قد تغير التخطيط.
لا. يعمل كل من التنسيق والضغط بالكامل داخل متصفحك، لذا لا يغادر الكود جهازك أبدا.
ضمّن هذه الأداة
أضف هذه الأداة إلى موقعك الخاص. انسخ المقتطف أدناه، ويبقى محدّثاً تلقائياً.
<iframe src="https://monu.tools/embed/ar/html-formatter" width="100%" height="640" style="border:1px solid #e5e5e5;border-radius:12px;max-width:680px" loading="lazy" title="Monu Tools"></iframe>أدوات ذات صلة
نسق وجمّل كود JavaScript بإزاحة ومباعدة متسقة. يعمل بالكامل داخل متصفحك.
حوّل CSV إلى ملف Excel بصيغة .xlsx وExcel مرة أخرى إلى CSV، بالكامل داخل متصفحك. يعمل في كلا الاتجاهين.
ولّد واجهات TypeScript من عينة JSON، مع الأنواع المتداخلة والمصفوفات والحقول الاختيارية. يعمل داخل متصفحك.
حوّل JSON إلى XML و XML إلى JSON، في الاتجاهين، بالكامل داخل متصفحك.