{"id":1390,"date":"2023-07-18T13:04:04","date_gmt":"2023-07-18T04:04:04","guid":{"rendered":"http:\/\/2ruja.com\/~game03\/?p=1390"},"modified":"2023-07-18T13:04:38","modified_gmt":"2023-07-18T04:04:38","slug":"html-code-for-computer-code","status":"publish","type":"post","link":"https:\/\/2ruja.com\/~game03\/wp\/?p=1390","title":{"rendered":"HTML &lt;code> For Computer Code"},"content":{"rendered":"\n<p>The HTML\u00a0<code>&lt;code><\/code>\u00a0element\u00a0 is used to define a piece of computer code. The content inside is displayed in the browser&#8217;s default monospace font.<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">The HTML &lt;code> element  is used to define a piece of computer code. The content inside is displayed in the browser's default monospace font.<\/pre>\n\n\n\n<p>Notice that the&nbsp;<code>&lt;code&gt;<\/code>&nbsp;element does not preserve extra whitespace and line-breaks.<\/p>\n\n\n\n<p>To fix this, you can put the&nbsp;<code>&lt;code&gt;<\/code>&nbsp;element inside a&nbsp;<code>&lt;pre&gt;<\/code>&nbsp;element:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">&lt;!DOCTYPE html>\n&lt;html>\n&lt;body>\n\n&lt;p>The code element does not preserve whitespace and line-breaks.&lt;\/p>\n&lt;p>To fix this, you can put the code element inside a pre element:&lt;\/p>\n\n&lt;pre>\n&lt;code>\nx = 5;\ny = 6;\nz = x + y;\n&lt;\/code>\n&lt;\/pre>\n\n&lt;\/body>\n&lt;\/html>\n\n<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>The HTML\u00a0&lt;code>\u00a0element\u00a0 is used to define a piece of computer code. The content inside is displayed in the browser&#8217;s default monospace font. Notice that the&nbsp;&lt;code&gt;&nbsp;element does not preserve extra whitespace and line-breaks. To fix this, you can put the&nbsp;&lt;code&gt;&nbsp;element inside a&nbsp;&lt;pre&gt;&nbsp;element:<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[40],"tags":[],"_links":{"self":[{"href":"https:\/\/2ruja.com\/~game03\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1390"}],"collection":[{"href":"https:\/\/2ruja.com\/~game03\/wp\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/2ruja.com\/~game03\/wp\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/2ruja.com\/~game03\/wp\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/2ruja.com\/~game03\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1390"}],"version-history":[{"count":2,"href":"https:\/\/2ruja.com\/~game03\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1390\/revisions"}],"predecessor-version":[{"id":1392,"href":"https:\/\/2ruja.com\/~game03\/wp\/index.php?rest_route=\/wp\/v2\/posts\/1390\/revisions\/1392"}],"wp:attachment":[{"href":"https:\/\/2ruja.com\/~game03\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1390"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/2ruja.com\/~game03\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1390"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/2ruja.com\/~game03\/wp\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1390"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}