﻿{"id":434,"date":"2026-01-23T08:41:39","date_gmt":"2026-01-23T07:41:39","guid":{"rendered":"https:\/\/lmspro.fr\/html-avance\/"},"modified":"2026-01-23T15:12:57","modified_gmt":"2026-01-23T14:12:57","slug":"html-avance","status":"publish","type":"post","link":"https:\/\/lmspro.fr\/en\/html-avance\/","title":{"rendered":"Advanced HTML"},"content":{"rendered":"<h2>Advanced HTML<\/h2>\n<p class=\"wpa-text\">Dive into the world of advanced HTML and discover how to create semantic and accessible websites. This guide will help you master modern HTML5 structures, how browsers work, and the essential basics for an optimal user experience.<\/p>\n<div class=\"article-meta\">\n<p><strong>Module:<\/strong> Module 1: Technical Fundamentals of the Web<\/p>\n<p><strong>Level :<\/strong> Beginner<\/p>\n<p><strong>Duration :<\/strong> 20 minutes<\/p>\n<p><strong>Prerequisites:<\/strong> None<\/p>\n<\/div>\n<h2>Educational objectives<\/h2>\n<ul>\n<li>Understanding the role of the browser in displaying web pages<\/li>\n<li>Mastering the fundamental concepts of the DOM and the CSSOM<\/li>\n<li>Identify and apply the 3 pillars of UX\/UI: semantics, accessibility, and SEO<\/li>\n<li>Create a semantic and accessible HTML5 structure<\/li>\n<li>Understanding the essential elements of a modern HTML5 document<\/li>\n<\/ul>\n<div class=\"wpa-accordion wpa-accordion-flush\" id=\"accordion-html-avance\">\n<div class=\"wpa-accordion-item\">\n<button class=\"wpa-accordion-header\" data-wpa-target=\"#accordion-html-avance-item-1\" aria-expanded=\"false\"><span class=\"wpa-accordion-title\"><span class=\"wpa-accordion-number\">01<\/span> The browser and page display<\/span><span class=\"wpa-accordion-icon\"><\/span><\/button><\/p>\n<div id=\"accordion-html-avance-item-1\" class=\"wpa-accordion-body\">\n<div class=\"wpa-accordion-content\">\n<h4>How the browser interprets your code<\/h4>\n<p>When you type a URL into your browser, a series of complex operations is triggered. The browser sends an HTTP request to the server hosting the website. Once the HTML code is received, the browser begins its work of interpretation: it reads the code line by line, builds an internal representation of the page (the DOM), and then applies CSS styles to create the final display.<\/p>\n<h4>The step-by-step rendering process<\/h4>\n<p>The rendering process follows a specific order: first, HTML parsing, then DOM construction, followed by CSS parsing and CSSOM creation, and finally, the combination of the two to generate the render tree. This process directly determines your site&#039;s performance and user experience. Understanding this mechanism allows you to optimize your code for faster loading times.<\/p>\n<div class=\"info-box\">\n<p><strong>Key point<\/strong> The browser processes HTML and CSS sequentially. Poorly structured code can significantly slow down the display of your page.<\/p>\n<\/div>\n<div class=\"tuto-objectif\" style=\"background: #f5f5f5;border-left: 4px solid #667eea;padding: 16px 20px;margin-top: 24px;border-radius: 0 8px 8px 0\">\n<h3 style=\"color: #667eea;margin: 0 0 8px 0;font-size: 16px\">Key points to remember<\/h3>\n<p style=\"margin: 0;color: #333\">The browser transforms your HTML code into a hierarchical structure (DOM) and then applies CSS styles to create the final display of the page.<\/p>\n<\/div>\n<div class=\"tuto-exercise\" style=\"background: #fff3e0;border-left: 4px solid #ff9800;padding: 16px 20px;margin-top: 20px;border-radius: 0 8px 8px 0\">\n<h4 style=\"color: #ff9800;margin: 0 0 8px 0;font-size: 15px\">\ud83c\udfaf Mini-exercise: Basic HTML structure<\/h4>\n<p style=\"margin: 0;color: #333;font-size: 14px\">Create a simple HTML page with the basic elements that the browser needs to interpret: doctype, head, title and body with content.<\/p>\n<\/div>\n<div class=\"codepen-block\" data-block-id=\"exercise-1\">\n<p class=\"codepen-block-label\">Reference code:<\/p>\n<div class=\"codepen-header\">\n<div class=\"codepen-tabs\">\n<button class=\"codepen-tab active\" data-tab=\"html\">HTML<\/button><br \/>\n<button class=\"codepen-tab\" data-tab=\"css\">CSS<\/button>\n<\/div>\n<p><button class=\"codepen-copy-btn\">Copy<\/button>\n<\/div>\n<div class=\"codepen-code-container\">\n<pre class=\"codepen-code active\" data-lang=\"html\">&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;fr&quot;&gt;\n&lt;head&gt;\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\n    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n    &lt;title&gt;Ma premi&egrave;re page&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;h1&gt;Welcome to my site&lt;\/h1&gt;\n    &lt;p&gt;The browser interprets this code to create this page.&lt;\/p&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<pre class=\"codepen-code\" data-lang=\"css\">body { font-family: Arial, sans-serif; margin: 0; padding: 20px; background-color: #f4f4f4; } h1 { color: #333; text-align: center; } p { line-height: 1.6; color: #666; }<\/pre>\n<\/div>\n<\/div>\n<div class=\"monaco-sandbox\" data-block-id=\"exercise-1\">\n<div class=\"monaco-header\">\n<div class=\"monaco-tabs\">\n<button class=\"monaco-tab active\" data-lang=\"html\">HTML<\/button><br \/>\n<button class=\"monaco-tab\" data-lang=\"css\">CSS<\/button>\n<\/div>\n<div class=\"monaco-actions\">\n<button class=\"monaco-btn monaco-btn-run\">\u25b6 Run<\/button><br \/>\n<button class=\"monaco-btn monaco-btn-reset\">\u21ba Reset<\/button><br \/>\n<button class=\"monaco-btn monaco-btn-save\">\ud83d\udcbe Save<\/button>\n<\/div>\n<\/div>\n<div class=\"monaco-container\">\n<div class=\"monaco-editor-wrapper\">\n<div class=\"monaco-editor-pane active\" data-lang=\"html\"><\/div>\n<div class=\"monaco-editor-pane\" data-lang=\"css\"><\/div>\n<\/div>\n<div class=\"monaco-preview-wrapper\">\n<div class=\"monaco-preview-header\">Result<\/div>\n<\/div>\n<\/div>\n<div class=\"monaco-status\">\n<span class=\"monaco-status-left\">\u25cf Ready<\/span><br \/>\n<span class=\"monaco-status-right\">Monaco Editor v0.45<\/span>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"wpa-accordion-item\">\n<button class=\"wpa-accordion-header\" data-wpa-target=\"#accordion-html-avance-item-2\" aria-expanded=\"false\"><span class=\"wpa-accordion-title\"><span class=\"wpa-accordion-number\">02<\/span> DOM and CSSOM: the invisible foundations<\/span><span class=\"wpa-accordion-icon\"><\/span><\/button><\/p>\n<div id=\"accordion-html-avance-item-2\" class=\"wpa-accordion-body\">\n<div class=\"wpa-accordion-content\">\n<h4>The DOM: the structure of your page<\/h4>\n<p>The Document Object Model (DOM) is the in-memory representation of your HTML page. Think of it as a family tree where each HTML element becomes a node with its parents, children, and siblings. This hierarchical structure allows the browser to understand the relationships between elements and manipulate them dynamically. The DOM is also the interface that JavaScript uses to interact with your page.<\/p>\n<h4>The CSSOM: the structured style sheet<\/h4>\n<p>Alongside the DOM, the browser builds the CSS Object Model (CSSOM) from your stylesheets. This structure contains all the CSS rules organized hierarchically, with their priority and cascading. The CSSOM determines which styles apply to each element in the DOM. Understanding these two models is essential for optimizing performance and effectively debugging your pages.<\/p>\n<div class=\"info-box\">\n<p><strong>Key point<\/strong> DOM + CSSOM = Render Tree. This equation represents what the user ultimately sees on the screen.<\/p>\n<\/div>\n<div class=\"tuto-objectif\" style=\"background: #f5f5f5;border-left: 4px solid #667eea;padding: 16px 20px;margin-top: 24px;border-radius: 0 8px 8px 0\">\n<h3 style=\"color: #667eea;margin: 0 0 8px 0;font-size: 16px\">Key points to remember<\/h3>\n<p style=\"margin: 0;color: #333\">The DOM structures your HTML into a tree of elements, while the CSSOM organizes your CSS styles. Their combination creates the final display.<\/p>\n<\/div>\n<div class=\"tuto-exercise\" style=\"background: #fff3e0;border-left: 4px solid #ff9800;padding: 16px 20px;margin-top: 20px;border-radius: 0 8px 8px 0\">\n<h4 style=\"color: #ff9800;margin: 0 0 8px 0;font-size: 15px\">\ud83c\udfaf Mini-exercise: DOM Hierarchy<\/h4>\n<p style=\"margin: 0;color: #333;font-size: 14px\">Create a hierarchical HTML structure with parent and child elements to understand the organization of the DOM.<\/p>\n<\/div>\n<div class=\"codepen-block\" data-block-id=\"exercise-2\">\n<p class=\"codepen-block-label\">Reference code:<\/p>\n<div class=\"codepen-header\">\n<div class=\"codepen-tabs\">\n<button class=\"codepen-tab active\" data-tab=\"html\">HTML<\/button><br \/>\n<button class=\"codepen-tab\" data-tab=\"css\">CSS<\/button>\n<\/div>\n<p><button class=\"codepen-copy-btn\">Copy<\/button>\n<\/div>\n<div class=\"codepen-code-container\">\n<pre class=\"codepen-code active\" data-lang=\"html\">&lt;article&gt;\n    &lt;header&gt;\n        &lt;h2&gt;Article Title&lt;\/h2&gt;\n        &lt;p&gt;Descriptive subtitle&lt;\/p&gt;\n    &lt;\/header&gt;\n    \n    &lt;section&gt;\n        &lt;h3&gt;Introduction&lt;\/h3&gt;\n        &lt;p&gt;Introduction content with &lt;strong&gt;important text&lt;\/strong&gt;.&lt;\/p&gt;\n        \n        &lt;ul&gt;\n            &lt;li&gt;First point&lt;\/li&gt;\n            &lt;li&gt;Second point&lt;\/li&gt;\n        &lt;\/ul&gt;\n    &lt;\/section&gt;\n&lt;\/article&gt;<\/pre>\n<pre class=\"codepen-code\" data-lang=\"css\">article { max-width: 600px; margin: 20px auto; padding: 20px; border: 1px solid #ddd; border-radius: 8px; } header { border-bottom: 2px solid #eee; padding-bottom: 15px; margin-bottom: 20px; } section { background: #f9f9f9; padding: 15px; border-radius: 5px; }<\/pre>\n<\/div>\n<\/div>\n<div class=\"monaco-sandbox\" data-block-id=\"exercise-2\">\n<div class=\"monaco-header\">\n<div class=\"monaco-tabs\">\n<button class=\"monaco-tab active\" data-lang=\"html\">HTML<\/button><br \/>\n<button class=\"monaco-tab\" data-lang=\"css\">CSS<\/button>\n<\/div>\n<div class=\"monaco-actions\">\n<button class=\"monaco-btn monaco-btn-run\">\u25b6 Run<\/button><br \/>\n<button class=\"monaco-btn monaco-btn-reset\">\u21ba Reset<\/button><br \/>\n<button class=\"monaco-btn monaco-btn-save\">\ud83d\udcbe Save<\/button>\n<\/div>\n<\/div>\n<div class=\"monaco-container\">\n<div class=\"monaco-editor-wrapper\">\n<div class=\"monaco-editor-pane active\" data-lang=\"html\"><\/div>\n<div class=\"monaco-editor-pane\" data-lang=\"css\"><\/div>\n<\/div>\n<div class=\"monaco-preview-wrapper\">\n<div class=\"monaco-preview-header\">Result<\/div>\n<\/div>\n<\/div>\n<div class=\"monaco-status\">\n<span class=\"monaco-status-left\">\u25cf Ready<\/span><br \/>\n<span class=\"monaco-status-right\">Monaco Editor v0.45<\/span>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"wpa-accordion-item\">\n<button class=\"wpa-accordion-header\" data-wpa-target=\"#accordion-html-avance-item-3\" aria-expanded=\"false\"><span class=\"wpa-accordion-title\"><span class=\"wpa-accordion-number\">03<\/span> The 3 pillars of UX\/UI: semantics, accessibility, SEO<\/span><span class=\"wpa-accordion-icon\"><\/span><\/button><\/p>\n<div id=\"accordion-html-avance-item-3\" class=\"wpa-accordion-body\">\n<div class=\"wpa-accordion-content\">\n<h4>Semantics: giving meaning to your content<\/h4>\n<p>HTML semantics involves using the correct tags for the correct content. A heading should use h1-h6, a paragraph the p tag, and a list the ul or ol tag. This approach allows browsers, search engines, and assistive technologies to understand the structure and meaning of your content. HTML5 elements like header, nav, main, section, and article enhance this semantics by clearly defining the different areas of your page.<\/p>\n<h4>Accessibility: a web for everyone<\/h4>\n<p>Accessibility ensures that your site is usable by everyone, including people with disabilities. This includes using alt attributes for images, labels for forms, a logical heading hierarchy, and sufficient color contrast. Screen readers and other assistive technologies rely on these elements to make your content accessible.<\/p>\n<h4>SEO: being found on the web<\/h4>\n<p>Search engine optimization (SEO) largely depends on the quality of your HTML. Search engines analyze your code to understand and index your content. A clear semantic structure, appropriate meta tags, and well-organized content significantly improve your visibility in search results.<\/p>\n<div class=\"info-box\">\n<p><strong>Key point<\/strong> These three pillars are interconnected: good semantics improves accessibility and SEO simultaneously.<\/p>\n<\/div>\n<div class=\"tuto-objectif\" style=\"background: #f5f5f5;border-left: 4px solid #667eea;padding: 16px 20px;margin-top: 24px;border-radius: 0 8px 8px 0\">\n<h3 style=\"color: #667eea;margin: 0 0 8px 0;font-size: 16px\">Key points to remember<\/h3>\n<p style=\"margin: 0;color: #333\">Semantics, accessibility and SEO form an inseparable trio that guarantees a high-quality, inclusive and well-referenced web.<\/p>\n<\/div>\n<div class=\"tuto-exercise\" style=\"background: #fff3e0;border-left: 4px solid #ff9800;padding: 16px 20px;margin-top: 20px;border-radius: 0 8px 8px 0\">\n<h4 style=\"color: #ff9800;margin: 0 0 8px 0;font-size: 15px\">\ud83c\udfaf Mini-exercise: Semantic Structure<\/h4>\n<p style=\"margin: 0;color: #333;font-size: 14px\">Create a page with a complete semantic structure using the appropriate HTML5 tags and accessibility attributes.<\/p>\n<\/div>\n<div class=\"codepen-block\" data-block-id=\"exercise-3\">\n<p class=\"codepen-block-label\">Reference code:<\/p>\n<div class=\"codepen-header\">\n<div class=\"codepen-tabs\">\n<button class=\"codepen-tab active\" data-tab=\"html\">HTML<\/button><br \/>\n<button class=\"codepen-tab\" data-tab=\"css\">CSS<\/button>\n<\/div>\n<p><button class=\"codepen-copy-btn\">Copy<\/button>\n<\/div>\n<div class=\"codepen-code-container\">\n<pre class=\"codepen-code active\" data-lang=\"html\">&lt;header role=&quot;banner&quot;&gt;\n    &lt;h1&gt;My Personal Blog&lt;\/h1&gt;\n    &lt;nav role=&quot;navigation&quot; aria-label=&quot;Main Menu&quot;&gt;\n        &lt;ul&gt;\n            &lt;li&gt;&lt;a href=&quot;#accueil&quot;&gt;Welcome&lt;\/a&gt;&lt;\/li&gt;\n            &lt;li&gt;&lt;a href=&quot;#articles&quot;&gt;Items&lt;\/a&gt;&lt;\/li&gt;\n        &lt;\/ul&gt;\n    &lt;\/nav&gt;\n&lt;\/header&gt;\n\n&lt;main role=&quot;main&quot;&gt;\n    &lt;article&gt;\n        &lt;h2&gt;First Article&lt;\/h2&gt;\n        &lt;img src=&quot;image.jpg&quot; alt=&quot;Description d&eacute;taill&eacute;e de l&#039;image&quot;&gt;\n        &lt;p&gt;Article content with a link &lt;a href=&quot;#&quot; aria-describedby=&quot;link-desc&quot;&gt;external&lt;\/a&gt;.&lt;\/p&gt;\n        &lt;span id=&quot;link-desc&quot; class=&quot;sr-only&quot;&gt;Opens in a new tab&lt;\/span&gt;\n    &lt;\/article&gt;\n&lt;\/main&gt;<\/pre>\n<pre class=\"codepen-code\" data-lang=\"css\">header { background: #2c3e50; color:white; padding: 20px; } nav ul { list-style: none; display:flex; gap: 20px; margin: 10px 0 0 0; padding: 0; } nav a { color: white; text-decoration: none; } nav a:hover { text-decoration: underline; } .sr-only { position: absolute; left: -10000px; width: 1px; height: 1px; overflow:hidden; }<\/pre>\n<\/div>\n<\/div>\n<div class=\"monaco-sandbox\" data-block-id=\"exercise-3\">\n<div class=\"monaco-header\">\n<div class=\"monaco-tabs\">\n<button class=\"monaco-tab active\" data-lang=\"html\">HTML<\/button><br \/>\n<button class=\"monaco-tab\" data-lang=\"css\">CSS<\/button>\n<\/div>\n<div class=\"monaco-actions\">\n<button class=\"monaco-btn monaco-btn-run\">\u25b6 Run<\/button><br \/>\n<button class=\"monaco-btn monaco-btn-reset\">\u21ba Reset<\/button><br \/>\n<button class=\"monaco-btn monaco-btn-save\">\ud83d\udcbe Save<\/button>\n<\/div>\n<\/div>\n<div class=\"monaco-container\">\n<div class=\"monaco-editor-wrapper\">\n<div class=\"monaco-editor-pane active\" data-lang=\"html\"><\/div>\n<div class=\"monaco-editor-pane\" data-lang=\"css\"><\/div>\n<\/div>\n<div class=\"monaco-preview-wrapper\">\n<div class=\"monaco-preview-header\">Result<\/div>\n<\/div>\n<\/div>\n<div class=\"monaco-status\">\n<span class=\"monaco-status-left\">\u25cf Ready<\/span><br \/>\n<span class=\"monaco-status-right\">Monaco Editor v0.45<\/span>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"wpa-accordion-item\">\n<button class=\"wpa-accordion-header\" data-wpa-target=\"#accordion-html-avance-item-4\" aria-expanded=\"false\"><span class=\"wpa-accordion-title\"><span class=\"wpa-accordion-number\">04<\/span> Minimum structure of an HTML5 document<\/span><span class=\"wpa-accordion-icon\"><\/span><\/button><\/p>\n<div id=\"accordion-html-avance-item-4\" class=\"wpa-accordion-body\">\n<div class=\"wpa-accordion-content\">\n<h4>The DOCTYPE and the root element<\/h4>\n<p>Every modern HTML5 document begins with the `DOCTYPE` declaration, which tells the browser to use the default language. The `&lt;html&gt;` element with the `lang` attribute defines the document&#039;s root and specifies the primary language of the content. This information is crucial for browsers, search engines, and assistive technologies, which adapt their behavior based on the detected language.<\/p>\n<h4>The head section: essential metadata<\/h4>\n<p>The head section contains all the metadata for your page. The meta element charset=&quot;UTF-8&quot; ensures correct character encoding. The viewport meta tag controls the display on mobile devices. The title element defines the title displayed in the browser tab and used by search engines. Other meta tags can specify the description, keywords, and social media information.<\/p>\n<h4>The body: visible content<\/h4>\n<p>The body element contains all the visible content of your page. It must be logically structured using HTML5 semantic elements: header for the heading, nav for navigation, main for the main content, section and article to organize information, aside for supplementary content, and footer for the footer. This clear structure facilitates maintenance and improves the user experience.<\/p>\n<div class=\"info-box\">\n<p><strong>Key point<\/strong> A well-formed HTML5 structure is the foundation of any modern and efficient web page.<\/p>\n<\/div>\n<div class=\"tuto-objectif\" style=\"background: #f5f5f5;border-left: 4px solid #667eea;padding: 16px 20px;margin-top: 24px;border-radius: 0 8px 8px 0\">\n<h3 style=\"color: #667eea;margin: 0 0 8px 0;font-size: 16px\">Key points to remember<\/h3>\n<p style=\"margin: 0;color: #333\">A complete HTML5 document includes a DOCTYPE, a head section with essential metadata, and a semantically structured body.<\/p>\n<\/div>\n<div class=\"tuto-exercise\" style=\"background: #fff3e0;border-left: 4px solid #ff9800;padding: 16px 20px;margin-top: 20px;border-radius: 0 8px 8px 0\">\n<h4 style=\"color: #ff9800;margin: 0 0 8px 0;font-size: 15px\">\ud83c\udfaf Mini-exercise: Complete HTML5 document<\/h4>\n<p style=\"margin: 0;color: #333;font-size: 14px\">Build a complete HTML5 document with all the necessary metadata and a modern semantic structure.<\/p>\n<\/div>\n<div class=\"codepen-block\" data-block-id=\"exercise-4\">\n<p class=\"codepen-block-label\">Reference code:<\/p>\n<div class=\"codepen-header\">\n<div class=\"codepen-tabs\">\n<button class=\"codepen-tab active\" data-tab=\"html\">HTML<\/button><br \/>\n<button class=\"codepen-tab\" data-tab=\"css\">CSS<\/button>\n<\/div>\n<p><button class=\"codepen-copy-btn\">Copy<\/button>\n<\/div>\n<div class=\"codepen-code-container\">\n<pre class=\"codepen-code active\" data-lang=\"html\">&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;fr&quot;&gt;\n&lt;head&gt;\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\n    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n    &lt;meta name=&quot;description&quot; content=&quot;Page d&#039;exemple HTML5 avec structure s&eacute;mantique compl&egrave;te&quot;&gt;\n    &lt;meta name=&quot;author&quot; content=&quot;Votre Nom&quot;&gt;\n    &lt;title&gt;Document HTML5 Moderne&lt;\/title&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;header&gt;\n        &lt;h1&gt;Modern Website&lt;\/h1&gt;\n        &lt;nav&gt;\n            &lt;a href=&quot;#accueil&quot;&gt;Welcome&lt;\/a&gt;\n            &lt;a href=&quot;#services&quot;&gt;Services&lt;\/a&gt;\n            &lt;a href=&quot;#contact&quot;&gt;Contact&lt;\/a&gt;\n        &lt;\/nav&gt;\n    &lt;\/header&gt;\n    \n    &lt;main&gt;\n        &lt;section&gt;\n            &lt;h2&gt;Main Content&lt;\/h2&gt;\n            &lt;p&gt;Your main content goes here.&lt;\/p&gt;\n        &lt;\/section&gt;\n    &lt;\/main&gt;\n    \n    &lt;footer&gt;\n        &lt;p&gt;&copy; 2024 My Website&lt;\/p&gt;\n    &lt;\/footer&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<pre class=\"codepen-code\" data-lang=\"css\">* { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: &#039;Segoe UI&#039;, Tahoma, Geneva, Verdana, sans-serif; line-height: 1.6; color: #333; } header { background: linear-gradient(135deg, #667eea 0%, #764ba2 100%); color:white; padding: 20px 0; text-align: center; } nav { margin-top: 10px; } nav a { color: white; text-decoration: none; margin: 0 15px; padding: 8px 16px; border-radius: 4px; transition: background 0.3s; } nav a:hover { background: rgba(255,255,255,0.2); } main { max-width: 800px; margin: 40px self; padding: 0 20px; } footer { background: #2c3e50; color:white; text-align: center; padding: 20px 0; margin-top: 40px; }<\/pre>\n<\/div>\n<\/div>\n<div class=\"monaco-sandbox\" data-block-id=\"exercise-4\">\n<div class=\"monaco-header\">\n<div class=\"monaco-tabs\">\n<button class=\"monaco-tab active\" data-lang=\"html\">HTML<\/button><br \/>\n<button class=\"monaco-tab\" data-lang=\"css\">CSS<\/button>\n<\/div>\n<div class=\"monaco-actions\">\n<button class=\"monaco-btn monaco-btn-run\">\u25b6 Run<\/button><br \/>\n<button class=\"monaco-btn monaco-btn-reset\">\u21ba Reset<\/button><br \/>\n<button class=\"monaco-btn monaco-btn-save\">\ud83d\udcbe Save<\/button>\n<\/div>\n<\/div>\n<div class=\"monaco-container\">\n<div class=\"monaco-editor-wrapper\">\n<div class=\"monaco-editor-pane active\" data-lang=\"html\"><\/div>\n<div class=\"monaco-editor-pane\" data-lang=\"css\"><\/div>\n<\/div>\n<div class=\"monaco-preview-wrapper\">\n<div class=\"monaco-preview-header\">Result<\/div>\n<\/div>\n<\/div>\n<div class=\"monaco-status\">\n<span class=\"monaco-status-left\">\u25cf Ready<\/span><br \/>\n<span class=\"monaco-status-right\">Monaco Editor v0.45<\/span>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<div class=\"wpa-accordion-item\">\n<button class=\"wpa-accordion-header\" data-wpa-target=\"#accordion-html-avance-item-5\" aria-expanded=\"false\"><span class=\"wpa-accordion-title\"><span class=\"wpa-accordion-number\">05<\/span> HTML5 Optimization and Best Practices<\/span><span class=\"wpa-accordion-icon\"><\/span><\/button><\/p>\n<div id=\"accordion-html-avance-item-5\" class=\"wpa-accordion-body\">\n<div class=\"wpa-accordion-content\">\n<h4>Optimized performance and charging<\/h4>\n<p>HTML optimization begins with a streamlined and logical structure. Avoid unnecessary divs and prioritize semantic elements. The loading order of resources is crucial: place critical CSS in the head section, and non-essential scripts before the closing body section. Use the `async` and `defer` attributes for external scripts, and optimize your images with modern formats and the `loading=&quot;lazy&quot;` attribute for lazy loading.<\/p>\n<h4>Validation and compatibility<\/h4>\n<p>Valid HTML code is essential for cross-browser compatibility and performance. Use the W3C validator to check your code and fix any errors. Ensure your code works on different browsers and devices. Polyfills can help support older browser versions when needed.<\/p>\n<h4>Maintenance and scalability<\/h4>\n<p>Structure your HTML clearly and with comments to facilitate maintenance. Use meaningful CSS classes following a methodology like BEM. Clearly separate the structure (HTML), presentation (CSS), and behavior (JavaScript). This modular approach facilitates future modifications and teamwork.<\/p>\n<div class=\"info-box\">\n<p><strong>Key point<\/strong> : Optimized and well-structured HTML is the foundation of any high-performing and maintainable web application.<\/p>\n<\/div>\n<div class=\"tuto-objectif\" style=\"background: #f5f5f5;border-left: 4px solid #667eea;padding: 16px 20px;margin-top: 24px;border-radius: 0 8px 8px 0\">\n<h3 style=\"color: #667eea;margin: 0 0 8px 0;font-size: 16px\">Key points to remember<\/h3>\n<p style=\"margin: 0;color: #333\">HTML optimization combines performance, validation, compatibility, and maintainability to create robust web applications.<\/p>\n<\/div>\n<div class=\"tuto-exercise\" style=\"background: #fff3e0;border-left: 4px solid #ff9800;padding: 16px 20px;margin-top: 20px;border-radius: 0 8px 8px 0\">\n<h4 style=\"color: #ff9800;margin: 0 0 8px 0;font-size: 15px\">\ud83c\udfaf Mini-exercise: Optimized page<\/h4>\n<p style=\"margin: 0;color: #333;font-size: 14px\">Create an optimized HTML page with asynchronous loading, lazy images and a clean structure for better performance.<\/p>\n<\/div>\n<div class=\"codepen-block\" data-block-id=\"exercise-5\">\n<p class=\"codepen-block-label\">Reference code:<\/p>\n<div class=\"codepen-header\">\n<div class=\"codepen-tabs\">\n<button class=\"codepen-tab active\" data-tab=\"html\">HTML<\/button><br \/>\n<button class=\"codepen-tab\" data-tab=\"css\">CSS<\/button>\n<\/div>\n<p><button class=\"codepen-copy-btn\">Copy<\/button>\n<\/div>\n<div class=\"codepen-code-container\">\n<pre class=\"codepen-code active\" data-lang=\"html\">&lt;!DOCTYPE html&gt;\n&lt;html lang=&quot;fr&quot;&gt;\n&lt;head&gt;\n    &lt;meta charset=&quot;UTF-8&quot;&gt;\n    &lt;meta name=&quot;viewport&quot; content=&quot;width=device-width, initial-scale=1.0&quot;&gt;\n    &lt;title&gt;Page Optimis&eacute;e&lt;\/title&gt;\n    &lt;!-- CSS critique inline pour performance --&gt;\n    &lt;style&gt;\n        body { font-family: system-ui; margin: 0; }\n        .hero { background: #f0f0f0; padding: 60px 20px; text-align: center; }\n    &lt;\/style&gt;\n&lt;\/head&gt;\n&lt;body&gt;\n    &lt;header class=&quot;hero&quot;&gt;\n        &lt;h1&gt;Optimized Site&lt;\/h1&gt;\n        &lt;p&gt;Performance and accessibility&lt;\/p&gt;\n    &lt;\/header&gt;\n    \n    &lt;main&gt;\n        &lt;section&gt;\n            &lt;h2&gt;Content with optimized images&lt;\/h2&gt;\n            &lt;img src=&quot;https:\/\/via.placeholder.com\/600x300&quot; \n                 alt=&quot;Image d&#039;exemple&quot; \n                 loading=&quot;lazy&quot; \n                 width=&quot;600&quot; \n                 height=&quot;300&quot;&gt;\n            &lt;p&gt;Main page content with optimized loading.&lt;\/p&gt;\n        &lt;\/section&gt;\n    &lt;\/main&gt;\n    \n    &lt;!-- Script non critique charg&eacute; en defer --&gt;\n    &lt;script defer&gt;\n        console.log(&#039;Script charg&eacute; apr&egrave;s le DOM&#039;);\n    &lt;\/script&gt;\n&lt;\/body&gt;\n&lt;\/html&gt;<\/pre>\n<pre class=\"codepen-code\" data-lang=\"css\">\/* Optimized external CSS *\/ main { max-width: 1000px; margin: 0 auto; padding: 40px 20px; } section { margin-bottom: 40px; } img { max-width: 100%; height: auto; border-radius: 8px; box-shadow: 0 4px 8px rgba(0,0,0,0.1); } \/* Media queries for responsive *\/ @media (max-width: 768px) { .hero { padding: 40px 15px; } main { padding: 20px 15px; } }<\/pre>\n<\/div>\n<\/div>\n<div class=\"monaco-sandbox\" data-block-id=\"exercise-5\">\n<div class=\"monaco-header\">\n<div class=\"monaco-tabs\">\n<button class=\"monaco-tab active\" data-lang=\"html\">HTML<\/button><br \/>\n<button class=\"monaco-tab\" data-lang=\"css\">CSS<\/button>\n<\/div>\n<div class=\"monaco-actions\">\n<button class=\"monaco-btn monaco-btn-run\">\u25b6 Run<\/button><br \/>\n<button class=\"monaco-btn monaco-btn-reset\">\u21ba Reset<\/button><br \/>\n<button class=\"monaco-btn monaco-btn-save\">\ud83d\udcbe Save<\/button>\n<\/div>\n<\/div>\n<div class=\"monaco-container\">\n<div class=\"monaco-editor-wrapper\">\n<div class=\"monaco-editor-pane active\" data-lang=\"html\"><\/div>\n<div class=\"monaco-editor-pane\" data-lang=\"css\"><\/div>\n<\/div>\n<div class=\"monaco-preview-wrapper\">\n<div class=\"monaco-preview-header\">Result<\/div>\n<\/div>\n<\/div>\n<div class=\"monaco-status\">\n<span class=\"monaco-status-left\">\u25cf Ready<\/span><br \/>\n<span class=\"monaco-status-right\">Monaco Editor v0.45<\/span>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n<h2>Summary<\/h2>\n<div class=\"tuto-recap\" style=\"background: #f5f5f5;border-left: 4px solid #9c27b0;padding: 16px 20px;border-radius: 0 8px 8px 0\">\n<h3 style=\"color: #9c27b0;margin: 0 0 12px 0;font-size: 16px\">Key points to remember<\/h3>\n<ul style=\"margin: 0;padding-left: 20px;color: #333\">\n<li><strong>Rendering process<\/strong> The browser transforms your HTML into DOM and your CSS into CSSOM to create the final display.<\/li>\n<li><strong>Hierarchical structure<\/strong> The DOM organizes your HTML elements in a tree structure, making navigation and manipulation easier.<\/li>\n<li><strong>Winning trio<\/strong> Semantics, accessibility, and SEO work together for a quality web<\/li>\n<li><strong>Modern HTML5<\/strong> DOCTYPE, complete metadata, and semantic structure are the essential foundations.<\/li>\n<li><strong>Overall optimization<\/strong> Performance, validation, and maintainability ensure the long-term viability of your web projects.<\/li>\n<\/ul>\n<\/div>\n<h2>Sources<\/h2>\n<div class=\"sources-box\" style=\"background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);border: 1px solid #cbd5e1;border-radius: 12px;padding: 16px;margin-bottom: 24px\">\n<p style=\"color: #64748b;margin: 0 0 12px 0;font-size: 13px\">To deepen your knowledge:<\/p>\n<ul style=\"margin: 0;padding-left: 0\">\n<li style=\"margin-bottom: 8px\">\n<a href=\"https:\/\/developer.mozilla.org\/fr\/docs\/Web\/HTML\/Element\" target=\"_blank\" rel=\"noopener noreferrer\" style=\"align-items: center;gap: 10px;padding: 10px 14px;background: white;border-radius: 8px;text-decoration: none;color: #1e293b;border: 1px solid #e2e8f0\"><br \/>\n<span style=\"color: #94a3b8\">\ud83d\udd17<\/span><br \/>\n<span style=\"flex: 1;font-weight: 500;color: #0f172a\">MDN \u2013 HTML Element Reference<\/span><br \/>\n<span style=\"color: #94a3b8\">\u2192<\/span><br \/>\n<\/a>\n<\/li>\n<li style=\"margin-bottom: 0\">\n<a href=\"https:\/\/web.dev\/learn\/html\/\" target=\"_blank\" rel=\"noopener noreferrer\" style=\"align-items: center;gap: 10px;padding: 10px 14px;background: white;border-radius: 8px;text-decoration: none;color: #1e293b;border: 1px solid #e2e8f0\"><br \/>\n<span style=\"color: #94a3b8\">\ud83d\udd17<\/span><br \/>\n<span style=\"flex: 1;font-weight: 500;color: #0f172a\">Web.dev \u2013 Complete HTML Course<\/span><br \/>\n<span style=\"color: #94a3b8\">\u2192<\/span><br \/>\n<\/a>\n<\/li>\n<\/ul>\n<\/div>\n<h2>Validate your knowledge<\/h2>\n<p>Test your understanding with this 10-question quiz:<\/p>\n<div id=\"quiz-block-1\" class=\"quiz-container\" data-quiz-json=\"https:\/\/lmspro.fr\/wp-content\/plugins\/generate-article-endpoint\/quiz-data\/en\/quiz-html-avance.json\" aria-label=\"Interactive Quiz\"><div class=\"quiz-loading\" role=\"status\" aria-live=\"polite\"><span class=\"quiz-sr-only\">Loading quiz...<\/span><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Advanced HTML: Dive into the world of advanced HTML and discover how to create semantic and accessible websites. This guide will help you master modern HTML5 structures, how browsers work, and the essential basics for an optimal user experience. Module: Module 1: Web Technical Fundamentals Level: Beginner Duration\u2026 <a href=\"https:\/\/lmspro.fr\/en\/html-avance\/\" class=\"more-link\">Read More<span class=\"screen-reader-text\"> \u00ab\u00a0HTML avanc\u00e9\u00a0\u00bb<\/span> &raquo;<\/a><\/p>","protected":false},"author":1,"featured_media":435,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[30],"tags":[34,25,26,132,27,28,133,2],"class_list":["post-434","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-module-1-fondamentaux-techniques-du-web","tag-accessibilite","tag-animation","tag-css","tag-fondamentaux-web","tag-html","tag-javascript","tag-js","tag-ux"],"_links":{"self":[{"href":"https:\/\/lmspro.fr\/en\/wp-json\/wp\/v2\/posts\/434","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/lmspro.fr\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/lmspro.fr\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/lmspro.fr\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/lmspro.fr\/en\/wp-json\/wp\/v2\/comments?post=434"}],"version-history":[{"count":1,"href":"https:\/\/lmspro.fr\/en\/wp-json\/wp\/v2\/posts\/434\/revisions"}],"predecessor-version":[{"id":473,"href":"https:\/\/lmspro.fr\/en\/wp-json\/wp\/v2\/posts\/434\/revisions\/473"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/lmspro.fr\/en\/wp-json\/wp\/v2\/media\/435"}],"wp:attachment":[{"href":"https:\/\/lmspro.fr\/en\/wp-json\/wp\/v2\/media?parent=434"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/lmspro.fr\/en\/wp-json\/wp\/v2\/categories?post=434"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/lmspro.fr\/en\/wp-json\/wp\/v2\/tags?post=434"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}