{"id":512,"date":"2023-09-24T04:45:00","date_gmt":"2023-09-24T04:45:00","guid":{"rendered":"https:\/\/www.cmsgalaxy.com\/blog\/?p=512"},"modified":"2023-09-24T04:45:02","modified_gmt":"2023-09-24T04:45:02","slug":"html-cheatsheet","status":"publish","type":"post","link":"https:\/\/www.cmsgalaxy.com\/blog\/html-cheatsheet\/","title":{"rendered":"HTML Cheatsheet"},"content":{"rendered":"\n<figure class=\"wp-block-image size-full\"><img loading=\"lazy\" decoding=\"async\" width=\"500\" height=\"960\" src=\"https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2023\/09\/4776863d40125fbe3f50dab3fd2ba1fa-1.jpg\" alt=\"\" class=\"wp-image-513\" srcset=\"https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2023\/09\/4776863d40125fbe3f50dab3fd2ba1fa-1.jpg 500w, https:\/\/www.cmsgalaxy.com\/blog\/wp-content\/uploads\/2023\/09\/4776863d40125fbe3f50dab3fd2ba1fa-1-156x300.jpg 156w\" sizes=\"auto, (max-width: 500px) 100vw, 500px\" \/><\/figure>\n\n\n\n<hr class=\"wp-block-separator has-alpha-channel-opacity\"\/>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html>  &lt;!-- Document type declaration -->\r\n\r\n&lt;html> &lt;!-- Root element -->\r\n\r\n&lt;head> &lt;!-- Document head containing metadata -->\r\n    &lt;meta charset=\"UTF-8\"> &lt;!-- Character encoding -->\r\n    &lt;meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"> &lt;!-- Responsive viewport settings -->\r\n    &lt;title>Your Page Title&lt;\/title> &lt;!-- Page title displayed in the browser tab -->\r\n    &lt;link rel=\"stylesheet\" href=\"styles.css\"> &lt;!-- Link to an external stylesheet -->\r\n    &lt;style>\r\n        \/* Internal CSS styles *\/\r\n    &lt;\/style>\r\n    &lt;script src=\"script.js\">&lt;\/script> &lt;!-- Link to an external JavaScript file -->\r\n&lt;\/head>\r\n\r\n&lt;body> &lt;!-- Document body where visible content goes -->\r\n    &lt;header> &lt;!-- Header section -->\r\n        &lt;h1>Heading 1&lt;\/h1> &lt;!-- Heading with the largest font size -->\r\n        &lt;h2>Heading 2&lt;\/h2> &lt;!-- Subheading -->\r\n        &lt;nav> &lt;!-- Navigation menu -->\r\n            &lt;ul>\r\n                &lt;li>&lt;a href=\"#\">Home&lt;\/a>&lt;\/li> &lt;!-- List item with a link -->\r\n                &lt;li>&lt;a href=\"#\">About&lt;\/a>&lt;\/li>\r\n                &lt;li>&lt;a href=\"#\">Services&lt;\/a>&lt;\/li>\r\n            &lt;\/ul>\r\n        &lt;\/nav>\r\n    &lt;\/header>\r\n\r\n    &lt;main> &lt;!-- Main content section -->\r\n        &lt;section> &lt;!-- Section with a heading -->\r\n            &lt;h2>Section Title&lt;\/h2>\r\n            &lt;p>This is a paragraph of text.&lt;\/p>\r\n            &lt;a href=\"https:\/\/www.example.com\">Visit Example&lt;\/a> &lt;!-- Link to an external website -->\r\n            &lt;img src=\"image.jpg\" alt=\"Image Description\"> &lt;!-- Image with alternative text -->\r\n        &lt;\/section>\r\n\r\n        &lt;article> &lt;!-- Independent, self-contained content -->\r\n            &lt;h3>Article Title&lt;\/h3>\r\n            &lt;p>Article content goes here.&lt;\/p>\r\n        &lt;\/article>\r\n    &lt;\/main>\r\n\r\n    &lt;aside> &lt;!-- Sidebar or supplementary content -->\r\n        &lt;h3>Sidebar Title&lt;\/h3>\r\n        &lt;ul>\r\n            &lt;li>Item 1&lt;\/li>\r\n            &lt;li>Item 2&lt;\/li>\r\n        &lt;\/ul>\r\n    &lt;\/aside>\r\n\r\n    &lt;footer> &lt;!-- Footer section -->\r\n        &lt;p>&amp;copy; 2023 Your Website Name&lt;\/p> &lt;!-- Copyright notice -->\r\n    &lt;\/footer>\r\n&lt;\/body>\r\n\r\n&lt;\/html>\r\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Structure<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;html&gt;<\/code>&nbsp;and&nbsp;<code>&lt;\/html&gt;<\/code>&nbsp;enclose the entire HTML document.<\/li>\n\n\n\n<li><code>&lt;head&gt;<\/code>&nbsp;and&nbsp;<code>&lt;\/head&gt;<\/code>&nbsp;contain information about the document, such as the title and meta tags.<\/li>\n\n\n\n<li><code>&lt;body&gt;<\/code>&nbsp;and&nbsp;<code>&lt;\/body&gt;<\/code>&nbsp;contain the content of the document, such as headings, paragraphs, and images.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Headings<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;h1&gt;<\/code>&nbsp;to&nbsp;<code>&lt;h6&gt;<\/code>&nbsp;create headings of different sizes.<\/li>\n\n\n\n<li><code>&lt;p&gt;<\/code>&nbsp;creates a paragraph.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Lists<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;ul&gt;<\/code>&nbsp;creates an unordered list.<\/li>\n\n\n\n<li><code>&lt;ol&gt;<\/code>&nbsp;creates an ordered list.<\/li>\n\n\n\n<li><code>&lt;li&gt;<\/code>&nbsp;creates a list item.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Images<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;img&gt;<\/code>&nbsp;inserts an image into the document.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Links<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;a&gt;<\/code>&nbsp;creates a link to another document or resource.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Tables<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;table&gt;<\/code>&nbsp;and&nbsp;<code>&lt;\/table&gt;<\/code>&nbsp;enclose a table.<\/li>\n\n\n\n<li><code>&lt;tr&gt;<\/code>&nbsp;and&nbsp;<code>&lt;\/tr&gt;<\/code>&nbsp;create rows in a table.<\/li>\n\n\n\n<li><code>&lt;td&gt;<\/code>&nbsp;and&nbsp;<code>&lt;\/td&gt;<\/code>&nbsp;create cells in a table.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Forms<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><code>&lt;form&gt;<\/code>&nbsp;and&nbsp;<code>&lt;\/form&gt;<\/code>&nbsp;enclose a form.<\/li>\n\n\n\n<li><code>&lt;input&gt;<\/code>&nbsp;creates a text input field.<\/li>\n\n\n\n<li><code>&lt;select&gt;<\/code>&nbsp;creates a drop-down list.<\/li>\n\n\n\n<li><code>&lt;button&gt;<\/code>&nbsp;creates a button.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\"><strong>Attributes<\/strong><\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li>Attributes are used to specify additional information about elements. For example, the\u00a0<code>src<\/code>\u00a0attribute of the\u00a0<code>&lt;img><\/code>\u00a0element specifies the source of the image.<\/li>\n<\/ul>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;!DOCTYPE html>\r\n&lt;html>\r\n&lt;head>\r\n  &lt;title>My Web Page&lt;\/title>\r\n&lt;\/head>\r\n&lt;body>\r\n  &lt;h1>This is my web page!&lt;\/h1>\r\n  &lt;p>This is a paragraph on my web page.&lt;\/p>\r\n  &lt;img src=\"https:\/\/example.com\/image.png\" alt=\"Image of a cat\">\r\n  &lt;ul>\r\n    &lt;li>Item 1&lt;\/li>\r\n    &lt;li>Item 2&lt;\/li>\r\n    &lt;li>Item 3&lt;\/li>\r\n  &lt;\/ul>\r\n&lt;\/body>\r\n&lt;\/html><\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>Structure Headings Lists Images Links Tables Forms Attributes<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-512","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts\/512","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/comments?post=512"}],"version-history":[{"count":1,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts\/512\/revisions"}],"predecessor-version":[{"id":514,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/posts\/512\/revisions\/514"}],"wp:attachment":[{"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/media?parent=512"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/categories?post=512"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.cmsgalaxy.com\/blog\/wp-json\/wp\/v2\/tags?post=512"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}