{"id":1767,"date":"2011-09-18T22:46:00","date_gmt":"2011-09-19T05:46:00","guid":{"rendered":"https:\/\/bryanhadaway.com\/?p=1767"},"modified":"2025-05-22T15:23:13","modified_gmt":"2025-05-22T22:23:13","slug":"code","status":"publish","type":"post","link":"https:\/\/webguy.io\/blog\/code\/","title":{"rendered":"Quick Code Snippets"},"content":{"rendered":"<p>I&#8217;m really putting the feelers out there on this cheat sheet, so I definitely need some feedback, if I&#8217;m to keep adding code snippets. Request a snippet:<\/p>\n<p><a href=\"#disqus_thread\" class=\"button\">Request a Code Snippet<\/a><\/p>\n<p>If you really want to dive headfirst into web designing, blogging, writing, etc., I recommend trying out <a href=\"https:\/\/wordpress.com\/\">WordPress.com<\/a> (completely free).<\/p>\n<p>If you&#8217;d rather have more control and do your own thing, you&#8217;ll first need to <a href=\"https:\/\/webguy.io\/blog\/web-hosting-best-vs-worst\/\">get hosting<\/a>, and then the self-hosted <a href=\"https:\/\/wordpress.org\/\">WordPress software<\/a>.<\/p>\n<p>Whether you want to build a static site, or a site on top of WordPress, you can pick up the starter website template and WordPress theme that I&#8217;ve created <a href=\"https:\/\/generic.tools\/\">here<\/a>.<\/p>\n<p>If you&#8217;re looking for a really basic HTML beginner&#8217;s guide, <a href=\"https:\/\/webguy.io\/blog\/super-basic-html-guide\/\">start here<\/a>.<\/p>\n<h2>HTML5 Doctype<\/h2>\n<pre><code>&lt;!DOCTYPE html&gt;<\/code><\/pre>\n<h2>HTML5 Page Template<\/h2>\n<pre><code>&lt;!DOCTYPE html&gt;\r\n\r\n&lt;html lang=&quot;en&quot;&gt;\r\n\r\n&lt;head&gt;\r\n\r\n&lt;meta charset=&quot;utf-8&quot; \/&gt;\r\n\r\n&lt;title&gt;Page Title | Company Name&lt;\/title&gt;\r\n\r\n&lt;link type=&quot;text\/css&quot; rel=&quot;stylesheet&quot; href=&quot;style.css&quot; \/&gt;\r\n\r\n&lt;\/head&gt;\r\n\r\n&lt;body&gt;\r\n\r\n&lt;header&gt;\r\n\r\n&lt;nav&gt;\r\n\r\n... ADD NAVIGATION HERE ...\r\n\r\n&lt;\/nav&gt;\r\n\r\n&lt;\/header&gt;\r\n\r\n&lt;article&gt;\r\n\r\n&lt;p&gt;... ADD CONTENT HERE ...&lt;\/p&gt;\r\n\r\n&lt;\/article&gt;\r\n\r\n&lt;footer&gt;\r\n\r\n... ADD COPYRIGHT HERE ...\r\n\r\n&lt;\/footer&gt;\r\n\r\n&lt;\/body&gt;\r\n\r\n&lt;\/html&gt;<\/code><\/pre>\n<h2>CSS Stylesheet Template<\/h2>\n<pre style=\"white-space:pre\"><code>html,body,div,span,applet,object,iframe,h1,h2,h3,h4,h5,h6,p,blockquote,pre,a,abbr,acronym,address,big,cite,code,del,dfn,em,img,ins,kbd,q,s,samp,small,strike,strong,sub,sup,tt,var,b,u,i,center,dl,dt,dd,ol,ul,li,fieldset,form,label,legend,table,caption,tbody,tfoot,thead,tr,th,td,article,aside,canvas,details,embed,figure,figcaption,footer,header,hgroup,menu,nav,output,ruby,section,summary,time,mark,audio,video{margin:0;padding:0;border:0;font-size:100%;font:inherit;vertical-align:baseline}\r\narticle,aside,details,figcaption,figure,footer,header,hgroup,menu,nav,section{display:block}\r\nbody{line-height:1}ol,ul{list-style:none}blockquote,q{quotes:none}blockquote:before,blockquote:after,q:before,q:after{content:'';content:none}table{border-collapse:collapse;border-spacing:0}\r\n\r\nbody{margin:40px 0;background:#eee}\r\nbody, input, textarea{font-family:arial,sans-serif;font-size:14px;color:#666;line-height:20px}\r\n\r\np{margin:10px 0}\r\nstrong{font-weight:bold}\r\nem{font-style:italic}\r\n\r\na{font-family:georgia,'times new roman',serif;color:#09f;text-decoration:none}\r\na:hover{text-decoration:underline}\r\n\r\nh1, h2, h3, h4, h5, h6{font-weight:normal}\r\n\r\ninput, textarea{padding:3px 5px 3px 5px;border:1px #999 solid;background:#f6f6f6}\r\ninput[type=submit]{cursor:pointer}\r\ntextarea{padding:6px 8px 6px 8px;overflow:auto}\r\n\r\nheader, article, footer{max-width:920px;padding:20px;margin:0 auto}\r\narticle{min-height:395px;height:100%;text-align:justify;border:4px double #ccc;box-shadow:0 5px 15px #aaa;background:#fff}\r\n\r\na img, input[type=image]{border:0 none}<\/code><\/pre>\n<h2>jQuery<\/h2>\n<p>Add the following between your <em>&lt;head&gt;&lt;\/head&gt;<\/em> tags:<\/p>\n<pre><code>&lt;script type=&quot;text\/javascript&quot; src=&quot;\/\/code.jquery.com\/jquery-latest.min.js&quot;&gt;&lt;\/script&gt;<\/code><\/pre>\n<p><em>Learn more about <a href=\"https:\/\/jquery.com\/\">jQuery<\/a>.<\/em><\/p>\n<h2>Canonical Link<\/h2>\n<p>Add the following between your <em>&lt;head&gt;&lt;\/head&gt;<\/em> tags:<\/p>\n<pre><code>&lt;link rel=&quot;canonical&quot; href=&quot;http:\/\/website.com\/&quot; \/&gt;<\/code><\/pre>\n<p><em>Learn more about the <a href=\"https:\/\/webguy.io\/blog\/super-simple-dynamic-canonical-link-code\/\">canonical link element<\/a>.<\/em><\/p>\n<h2>HTML Entity Symbols<\/h2>\n<p>Copyright: &copy;<\/p>\n<pre><code>&amp;copy;<\/code><\/pre>\n<p>Heart: &hearts;<\/p>\n<pre><code>&amp;hearts;<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;m really putting the feelers out there on this cheat sheet, so I definitely need some feedback, if I&#8217;m to keep adding code snippets. Request a snippet: Request a Code Snippet If you really want to dive headfirst into web designing, blogging, writing, etc., I recommend trying out WordPress.com (completely free). If you&#8217;d rather have <a href=\"https:\/\/webguy.io\/blog\/code\/\" class=\"more-link\">&#8230;<span class=\"screen-reader-text\">  Quick Code Snippets<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[39],"tags":[239,254,278,281,277],"class_list":["post-1767","post","type-post","status-publish","format-standard","hentry","category-code","tag-code","tag-css","tag-css3","tag-html","tag-html5"],"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/posts\/1767","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/comments?post=1767"}],"version-history":[{"count":0,"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/posts\/1767\/revisions"}],"wp:attachment":[{"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/media?parent=1767"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/categories?post=1767"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/webguy.io\/blog\/wp-json\/wp\/v2\/tags?post=1767"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}