{"id":459,"date":"2021-07-16T10:30:00","date_gmt":"2021-07-16T05:00:00","guid":{"rendered":"https:\/\/wpproonline.com\/?p=459"},"modified":"2026-02-26T10:40:35","modified_gmt":"2026-02-26T10:40:35","slug":"chapter-34-marking-up-computer-code","status":"publish","type":"post","link":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/","title":{"rendered":"Chapter 34: Marking up computer code"},"content":{"rendered":"\n<h2 class=\"wp-block-heading\" id=\"h-block-with-per-and-code\">Block with <strong><em>&lt;per&gt;<\/em><\/strong> and <em>&lt;code&gt;<\/em><\/h2>\n\n<p class=\"wp-block-paragraph\">If the formatting (white space, new lines, indentation) of the code matters, use the pre element in combination with<br \/>the code element:<\/p>\n\n<p><!--more--><\/p>\n\n<pre data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;pre&gt;\n &lt;code&gt;\n x = 42\n if x == 42:\n print \"x is \u2026 \u2026 42\"\n &lt;\/code&gt;\n&lt;\/pre&gt;<\/pre>\n\n<p class=\"wp-block-paragraph\">You still have to escape characters with special meaning in HTML (like &lt; with &lt;), <em>so for displaying a block of HTML code<\/em> (<strong><em>&lt;p&gt;<\/em><\/strong> <em>This is a paragraph.<\/em><strong><em>&lt;\/p&gt;<\/em><\/strong>), it could look like this:<\/p>\n\n<pre data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;pre&gt;\n &lt;code&gt;\n &amp;lt;p&gt;This is a paragraph.&amp;lt;\/p&gt;\n &lt;\/code&gt;\n&lt;\/pre&gt;<\/pre>\n\n<h2 class=\"wp-block-heading\" id=\"h-inline-with-code\">Inline with <em>&lt;code&gt;<\/em><\/h2>\n\n<p class=\"wp-block-paragraph\">If a sentence contains computer code (for example, the name of an HTML element), use the code element to mark it<br \/>up:<\/p>\n\n<pre data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;p&gt;The &lt;code&gt;a&lt;\/code&gt; element creates a hyperlink.&lt;\/p&gt;<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Block with &lt;per&gt; and &lt;code&gt; If the formatting (white space, new lines, indentation) of the code matters, use the pre element in combination withthe code element:<\/p>\n","protected":false},"author":1,"featured_media":568,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"inline_featured_image":false,"footnotes":""},"categories":[73,76,111,77],"tags":[110,112,136,154,113],"class_list":["post-459","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-css","category-html","category-html-5-notes-for-professional","category-javascript","tag-html-5-notes","tag-html-5-tutorial","tag-html-resources","tag-html-with-css","tag-html5"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v27.0 (Yoast SEO v27.9) - https:\/\/yoast.com\/product\/yoast-seo-premium-wordpress\/ -->\n<title>Chapter 34: Marking up computer code - DigitalHubZ<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Chapter 34: Marking up computer code\" \/>\n<meta property=\"og:description\" content=\"Block with &lt;per&gt; and &lt;code&gt; If the formatting (white space, new lines, indentation) of the code matters, use the pre element in combination withthe code element:\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/\" \/>\n<meta property=\"og:site_name\" content=\"DigitalHubZ\" \/>\n<meta property=\"article:published_time\" content=\"2021-07-16T05:00:00+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-02-26T10:40:35+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.digitalhubz.com\/blog\/wp-content\/uploads\/2021\/07\/HTML-5-Notes-For-Professional-Chapter-34.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"945\" \/>\n\t<meta property=\"og:image:height\" content=\"394\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\n<meta name=\"author\" content=\"DigitalHubZ\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"DigitalHubZ\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/\"},\"author\":{\"name\":\"DigitalHubZ\",\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/#\\\/schema\\\/person\\\/5a4074d837d6e5d22d665e5b7ca9e873\"},\"headline\":\"Chapter 34: Marking up computer code\",\"datePublished\":\"2021-07-16T05:00:00+00:00\",\"dateModified\":\"2026-02-26T10:40:35+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/\"},\"wordCount\":99,\"commentCount\":3,\"publisher\":{\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/#organization\"},\"image\":{\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/HTML-5-Notes-For-Professional-Chapter-34.jpg\",\"keywords\":[\"HTML 5 Notes\",\"HTML 5 Tutorial\",\"HTML Resources\",\"HTML with CSS\",\"HTML5\"],\"articleSection\":[\"CSS\",\"HTML\",\"HTML 5 Notes For Professional\",\"Javascript\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/\",\"url\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/\",\"name\":\"Chapter 34: Marking up computer code - DigitalHubZ\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/HTML-5-Notes-For-Professional-Chapter-34.jpg\",\"datePublished\":\"2021-07-16T05:00:00+00:00\",\"dateModified\":\"2026-02-26T10:40:35+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/HTML-5-Notes-For-Professional-Chapter-34.jpg\",\"contentUrl\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/wp-content\\\/uploads\\\/2021\\\/07\\\/HTML-5-Notes-For-Professional-Chapter-34.jpg\",\"width\":945,\"height\":394},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/chapter-34-marking-up-computer-code\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Chapter 34: Marking up computer code\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/#website\",\"url\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/\",\"name\":\"DigitalHubZ\",\"description\":\"Future-Ready Digital Solutions\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/#organization\",\"name\":\"DigitalHubZ\",\"url\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\",\"url\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/digitalhubz.webp\",\"contentUrl\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/wp-content\\\/uploads\\\/2023\\\/03\\\/digitalhubz.webp\",\"width\":1232,\"height\":369,\"caption\":\"DigitalHubZ\"},\"image\":{\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/#\\\/schema\\\/logo\\\/image\\\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/#\\\/schema\\\/person\\\/5a4074d837d6e5d22d665e5b7ca9e873\",\"name\":\"DigitalHubZ\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/414c5bb85907e15e0f840541718ecc7420d52ea432b33f6a57761a674a52ebb7?s=96&d=mm&r=g\",\"url\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/414c5bb85907e15e0f840541718ecc7420d52ea432b33f6a57761a674a52ebb7?s=96&d=mm&r=g\",\"contentUrl\":\"https:\\\/\\\/secure.gravatar.com\\\/avatar\\\/414c5bb85907e15e0f840541718ecc7420d52ea432b33f6a57761a674a52ebb7?s=96&d=mm&r=g\",\"caption\":\"DigitalHubZ\"},\"sameAs\":[\"https:\\\/\\\/digitalhubz.com\"],\"url\":\"https:\\\/\\\/www.digitalhubz.com\\\/blog\\\/author\\\/digi_v1_wp\\\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"Chapter 34: Marking up computer code - DigitalHubZ","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/","og_locale":"en_US","og_type":"article","og_title":"Chapter 34: Marking up computer code","og_description":"Block with &lt;per&gt; and &lt;code&gt; If the formatting (white space, new lines, indentation) of the code matters, use the pre element in combination withthe code element:","og_url":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/","og_site_name":"DigitalHubZ","article_published_time":"2021-07-16T05:00:00+00:00","article_modified_time":"2026-02-26T10:40:35+00:00","og_image":[{"width":945,"height":394,"url":"https:\/\/www.digitalhubz.com\/blog\/wp-content\/uploads\/2021\/07\/HTML-5-Notes-For-Professional-Chapter-34.jpg","type":"image\/jpeg"}],"author":"DigitalHubZ","twitter_card":"summary_large_image","twitter_misc":{"Written by":"DigitalHubZ","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/#article","isPartOf":{"@id":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/"},"author":{"name":"DigitalHubZ","@id":"https:\/\/www.digitalhubz.com\/blog\/#\/schema\/person\/5a4074d837d6e5d22d665e5b7ca9e873"},"headline":"Chapter 34: Marking up computer code","datePublished":"2021-07-16T05:00:00+00:00","dateModified":"2026-02-26T10:40:35+00:00","mainEntityOfPage":{"@id":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/"},"wordCount":99,"commentCount":3,"publisher":{"@id":"https:\/\/www.digitalhubz.com\/blog\/#organization"},"image":{"@id":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/#primaryimage"},"thumbnailUrl":"https:\/\/www.digitalhubz.com\/blog\/wp-content\/uploads\/2021\/07\/HTML-5-Notes-For-Professional-Chapter-34.jpg","keywords":["HTML 5 Notes","HTML 5 Tutorial","HTML Resources","HTML with CSS","HTML5"],"articleSection":["CSS","HTML","HTML 5 Notes For Professional","Javascript"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/","url":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/","name":"Chapter 34: Marking up computer code - DigitalHubZ","isPartOf":{"@id":"https:\/\/www.digitalhubz.com\/blog\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/#primaryimage"},"image":{"@id":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/#primaryimage"},"thumbnailUrl":"https:\/\/www.digitalhubz.com\/blog\/wp-content\/uploads\/2021\/07\/HTML-5-Notes-For-Professional-Chapter-34.jpg","datePublished":"2021-07-16T05:00:00+00:00","dateModified":"2026-02-26T10:40:35+00:00","breadcrumb":{"@id":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/#primaryimage","url":"https:\/\/www.digitalhubz.com\/blog\/wp-content\/uploads\/2021\/07\/HTML-5-Notes-For-Professional-Chapter-34.jpg","contentUrl":"https:\/\/www.digitalhubz.com\/blog\/wp-content\/uploads\/2021\/07\/HTML-5-Notes-For-Professional-Chapter-34.jpg","width":945,"height":394},{"@type":"BreadcrumbList","@id":"https:\/\/www.digitalhubz.com\/blog\/chapter-34-marking-up-computer-code\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.digitalhubz.com\/blog\/"},{"@type":"ListItem","position":2,"name":"Chapter 34: Marking up computer code"}]},{"@type":"WebSite","@id":"https:\/\/www.digitalhubz.com\/blog\/#website","url":"https:\/\/www.digitalhubz.com\/blog\/","name":"DigitalHubZ","description":"Future-Ready Digital Solutions","publisher":{"@id":"https:\/\/www.digitalhubz.com\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.digitalhubz.com\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/www.digitalhubz.com\/blog\/#organization","name":"DigitalHubZ","url":"https:\/\/www.digitalhubz.com\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.digitalhubz.com\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/www.digitalhubz.com\/blog\/wp-content\/uploads\/2023\/03\/digitalhubz.webp","contentUrl":"https:\/\/www.digitalhubz.com\/blog\/wp-content\/uploads\/2023\/03\/digitalhubz.webp","width":1232,"height":369,"caption":"DigitalHubZ"},"image":{"@id":"https:\/\/www.digitalhubz.com\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/www.digitalhubz.com\/blog\/#\/schema\/person\/5a4074d837d6e5d22d665e5b7ca9e873","name":"DigitalHubZ","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/secure.gravatar.com\/avatar\/414c5bb85907e15e0f840541718ecc7420d52ea432b33f6a57761a674a52ebb7?s=96&d=mm&r=g","url":"https:\/\/secure.gravatar.com\/avatar\/414c5bb85907e15e0f840541718ecc7420d52ea432b33f6a57761a674a52ebb7?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/414c5bb85907e15e0f840541718ecc7420d52ea432b33f6a57761a674a52ebb7?s=96&d=mm&r=g","caption":"DigitalHubZ"},"sameAs":["https:\/\/digitalhubz.com"],"url":"https:\/\/www.digitalhubz.com\/blog\/author\/digi_v1_wp\/"}]}},"_links":{"self":[{"href":"https:\/\/www.digitalhubz.com\/blog\/wp-json\/wp\/v2\/posts\/459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.digitalhubz.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.digitalhubz.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.digitalhubz.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.digitalhubz.com\/blog\/wp-json\/wp\/v2\/comments?post=459"}],"version-history":[{"count":4,"href":"https:\/\/www.digitalhubz.com\/blog\/wp-json\/wp\/v2\/posts\/459\/revisions"}],"predecessor-version":[{"id":54763,"href":"https:\/\/www.digitalhubz.com\/blog\/wp-json\/wp\/v2\/posts\/459\/revisions\/54763"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.digitalhubz.com\/blog\/wp-json\/wp\/v2\/media\/568"}],"wp:attachment":[{"href":"https:\/\/www.digitalhubz.com\/blog\/wp-json\/wp\/v2\/media?parent=459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.digitalhubz.com\/blog\/wp-json\/wp\/v2\/categories?post=459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.digitalhubz.com\/blog\/wp-json\/wp\/v2\/tags?post=459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}