<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/"
    xmlns:atom="http://www.w3.org/2005/Atom" xmlns:media="http://search.yahoo.com/mrss/" version="2.0">
    <channel>
        
        <title>
            <![CDATA[ boilerplate - freeCodeCamp.org ]]>
        </title>
        <description>
            <![CDATA[ Browse thousands of programming tutorials written by experts. Learn Web Development, Data Science, DevOps, Security, and get developer career advice. ]]>
        </description>
        <link>https://www.freecodecamp.org/news/</link>
        <image>
            <url>https://cdn.freecodecamp.org/universal/favicons/favicon.png</url>
            <title>
                <![CDATA[ boilerplate - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Mon, 11 May 2026 22:40:31 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/boilerplate/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ HTML Starter Template – A Basic HTML5 Boilerplate for index.html ]]>
                </title>
                <description>
                    <![CDATA[ By Dillion Megida HTML has different tags, some of which have semantic meanings. A basic boilerplate for an HTML file looks like this: <!DOCTYPE html> <html lang="en">   <head>     <meta charset="UTF-8">     <meta name="viewport" content="width=devic... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/html-starter-template-a-basic-html5-boilerplate-for-index-html/</link>
                <guid isPermaLink="false">66d84f2a4540581f645440f3</guid>
                
                    <category>
                        <![CDATA[ boilerplate ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML5 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Fri, 25 Mar 2022 23:18:46 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2022/03/pexels-pixabay-270404.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Dillion Megida</p>
<p>HTML has different tags, some of which have semantic meanings. A basic boilerplate for an HTML file looks like this:</p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">http-equiv</span>=<span class="hljs-string">"X-UA-Compatible"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"ie=edge"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>My Website<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"./style.css"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"icon"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"./favicon.ico"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"image/x-icon"</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">main</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Welcome to My Website<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>  
    <span class="hljs-tag">&lt;/<span class="hljs-name">main</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"index.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>In the rest of this article, I'll explain what each part of this boilerplate means.</p>
<h1 id="heading-html-boilerplate-syntax">HTML Boilerplate Syntax</h1>
<h2 id="heading-doctype">DOCTYPE</h2>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
</code></pre>
<p>This element is the doctype declaration of the HTML file. <code>&lt;!DOCTYPE html&gt;</code> tells the browser to render the HTML codes as HTML5 (as opposed to some other version of HTML). </p>
<p>This is important, because without this declaration, HTML5 elements like <code>section</code>, <code>article</code>, and so on may not be rendered correctly.</p>
<h2 id="heading-html-tag">html tag</h2>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span>
    ...
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>The <code>html</code> tag is the root of the HTML document. It houses the <code>head</code> tag, the <code>body</code> tag, and every other HTML element (except the DOCTYPE) used in your website.</p>
<p>It also has the <code>lang</code> attribute, which you can use to specify the language of the text content on a website. The default value is "unknown", so it is recommended that you always specify a language. </p>
<p>Defining a language helps screen readers read words correctly and helps search engines return language-specific search results.</p>
<h2 id="heading-head-tag">head tag</h2>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    ...
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
</code></pre>
<p>The <code>head</code> tag houses the metadata of your website. These are visually invisible data to the user, but they provide information about your website's content. Search engines especially use this data to rank your website.</p>
<p>Metadata in the head tag includes meta tags, title tags, link tags, scripts, stylesheets, and more.</p>
<h2 id="heading-meta-tags">meta tags</h2>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">...</span> /&gt;</span>
</code></pre>
<p>The <code>meta</code> tag is a metadata element used to add more metadata to your website than the kind that non-meta tags like title provide.</p>
<p>You can use these tags for various purposes:</p>
<ul>
<li>adding metadata for social media platforms to create link previews</li>
<li>adding a description for your website</li>
<li>adding a character encoding for your website</li>
<li>and many more.</li>
</ul>
<p>Search engines, social media platforms, and web services use this metadata to understand the content of your website and determine how to present them to users.</p>
<h2 id="heading-title-tag">title tag</h2>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>My Website<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
</code></pre>
<p>The <code>title</code> tag is used to specify a title for your website. Your browser uses this to display a title at the title bar:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/03/Screenshot-2022-03-25-at-07.38.56.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>This tag also helps search engines show titles for your website on their search results:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/03/Screenshot-2022-03-25-at-07.44.11.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-link-tag">link tag</h2>
<p>You use the <code>link</code> tag, as the name implies, to link to another document. Usually, this establishes different kinds of relationships between the current document and a separate document.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"./style.css"</span>&gt;</span>
</code></pre>
<p>For example, as seen in the code block above, we've established a "stylesheet" document relationship with the styles.css file.</p>
<p>The most common use of this tag is to add stylesheets to a document and to also add favicons to a website:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"icon"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"./favicon.ico"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"image/x-icon"</span>&gt;</span>
</code></pre>
<p>A favicon is a small image close to the title of the webpage, as seen below:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2022/03/Screenshot-2022-03-25-at-07.38.56-1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-body-tag">body tag</h2>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    ...
<span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
</code></pre>
<p>The <code>body</code> tag houses the body content of a website, which is visible to users. Although non-visible elements like <code>style</code> and <code>script</code> can also be added here, most body tags are usually visible.</p>
<p>From headings to paragraphs to media and lots more, those elements are added here. Any element not found here (which could be included in the head tag) will not be shown on the screen.</p>
<h2 id="heading-main-tag">main tag</h2>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">main</span>&gt;</span>
    ...
<span class="hljs-tag">&lt;/<span class="hljs-name">main</span>&gt;</span>
</code></pre>
<p>The <code>main</code> tag specifies the essential content of a website. This would be the content related to the website's title.</p>
<p>For example, a blog post page. The social media sharing on the left, advertisements on the right, header, and footer are minor parts of the web page. The post itself showing the cover image, the title, and post text content is the central part, which would be in the <code>main</code> element.</p>
<h2 id="heading-h1-tag">h1 tag</h2>
<p>HTML has different heading elements which are <code>h1</code>, <code>h2</code>, <code>h3</code>, <code>h4</code>, <code>h5</code> and <code>h6</code>. Heading elements are used to describe different sections of a web page. And these elements have an order, with the <code>h1</code> being the highest.</p>
<p>You should only have one <code>h1</code> element on a webpage as this starts the main section. And then, you have other sections and subsections for which you can use the other heading elements.</p>
<p>Also, note that you shouldn't skip headings. For example, you shouldn't use an <code>h4</code> element after using an <code>h2</code> element. A good structure could be like this:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Welcome to my website<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>What do I have to offer<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>1. Financial Benefits<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>2. Society improves<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">h4</span>&gt;</span>a. Improving the tax system<span class="hljs-tag">&lt;/<span class="hljs-name">h4</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">h4</span>&gt;</span>b. Providing more refuse dumps<span class="hljs-tag">&lt;/<span class="hljs-name">h4</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>Who am I<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">h2</span>&gt;</span>Conclusion<span class="hljs-tag">&lt;/<span class="hljs-name">h2</span>&gt;</span>
</code></pre>
<p>From this code, you can see how the heading levels specify their position in sections and subsections.</p>
<h1 id="heading-wrap-up">Wrap up</h1>
<p>In this piece, we've seen an HTML starter boilerplate and what each tag used in this template means. </p>
<p>This list of elements is non-exhaustive as many more elements can be found in the head tag and the body tag, with numerous attributes, too.</p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Basic HTML5 Template: Use This HTML Boilerplate as a Starter for Any Web Dev Project ]]>
                </title>
                <description>
                    <![CDATA[ When you are building a new website, it is important to have a good starting foundation. In this article, I will explain what an HTML 5 boilerplate is and how to create a basic template to use in your projects.  What is an HTML 5 boilerplate? Accordi... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/basic-html5-template-boilerplate-code-example/</link>
                <guid isPermaLink="false">66b8d932ce55d3ba4d93598d</guid>
                
                    <category>
                        <![CDATA[ boilerplate ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML ]]>
                    </category>
                
                    <category>
                        <![CDATA[ HTML5 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ Jessica Wilkins ]]>
                </dc:creator>
                <pubDate>Fri, 30 Jul 2021 22:41:08 +0000</pubDate>
                <media:content url="https://www.freecodecamp.org/news/content/images/2021/07/jackson-so-_t-l5FFH8VA-unsplash.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>When you are building a new website, it is important to have a good starting foundation. In this article, I will explain what an HTML 5 boilerplate is and how to create a basic template to use in your projects. </p>
<h2 id="heading-what-is-an-html-5-boilerplate">What is an HTML 5 boilerplate?</h2>
<p>According to <a target="_blank" href="https://en.wikipedia.org/wiki/Boilerplate_code#HTML">Wikipedia</a>, </p>
<blockquote>
<p><strong>boilerplate code</strong> or just <strong>boilerplate</strong> are sections of code that are repeated in multiple places with little to no variation.</p>
</blockquote>
<p>A boilerplate in HTML is a template you will add at the start of your project. You should add this boilerplate to all of your HTML pages. </p>
<h2 id="heading-example-of-html-5-boilerplate">Example of HTML 5 boilerplate</h2>
<p>Let's take a look at a basic example.</p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">http-equiv</span>=<span class="hljs-string">"X-UA-Compatible"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"ie=edge"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>HTML 5 Boilerplate<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"style.css"</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"index.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<h3 id="heading-what-is-a-doctype-in-html">What is a doctype in HTML?</h3>
<p>The first line in your HTML code should be the doctype declaration. A doctype tells the browser what version of HTML the page is written in. </p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
</code></pre>
<p>If you forget to include this line of code in your file, then some of the HTML 5 tags like <code>&lt;article&gt;</code>, <code>&lt; footer &gt;</code>, and <code>&lt;header&gt;</code>  may not be supported by the browser.</p>
<h3 id="heading-what-is-the-html-root-element">What is the HTML root element?</h3>
<p>The <code>&lt;html&gt;</code> tag is the top level element of the HTML file. You will nest the <code>&lt;head&gt;</code> and <code>&lt;body&gt;</code> tags inside of it.</p>
<pre><code class="lang-html"><span class="hljs-meta">&lt;!DOCTYPE <span class="hljs-meta-keyword">html</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">html</span> <span class="hljs-attr">lang</span>=<span class="hljs-string">"en"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">body</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">body</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">html</span>&gt;</span>
</code></pre>
<p>The <code>lang</code> attribute inside the opening <code>&lt;html&gt;</code> tag sets the language for the page. It is also good to include it for accessibility reasons, because screen readers will know how to properly pronounce the text. </p>
<h3 id="heading-what-are-head-tags-in-html">What are head tags in HTML?</h3>
<p>The <code>&lt;head&gt;</code> tags contain information that is processed by machines. Inside the <code>&lt;head&gt;</code> tags, you will nest metadata which is data that describes the document to the machine. </p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">head</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">http-equiv</span>=<span class="hljs-string">"X-UA-Compatible"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"ie=edge"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>HTML 5 Boilerplate<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"style.css"</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">head</span>&gt;</span>
</code></pre>
<h3 id="heading-what-is-utf-8-character-encoding">What is UTF-8 character encoding?</h3>
<p>UTF-8 is the standard character encoding you should use in your web pages. This will usually be the first <code>&lt;meta&gt;</code> tag shown in the <code>&lt;head&gt;</code> element.</p>
<pre><code class="lang-html"> <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">charset</span>=<span class="hljs-string">"UTF-8"</span>&gt;</span>
</code></pre>
<p>According to the <a target="_blank" href="https://www.w3.org/International/questions/qa-choosing-encodings">World Wide Web Consortium</a>, </p>
<blockquote>
<p>A Unicode-based encoding such as UTF-8 can support many languages and can accommodate pages and forms in any mixture of those languages. Its use also eliminates the need for server-side logic to individually determine the character encoding for each page served or each incoming form submission.</p>
</blockquote>
<h3 id="heading-what-is-the-viewport-meta-tag-in-html">What is the viewport meta tag in HTML?</h3>
<p>This tag renders the width of the page to the width of the device's screen size. If you have a mobile device that is 600px wide, then the browser window will also be 600px wide.</p>
<p>The initial-scale controls the zoom level. The value of 1 for the initial-scale prevents the default zoom by browsers. </p>
<pre><code class="lang-html">    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"viewport"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"width=device-width, initial-scale=1.0"</span>&gt;</span>
</code></pre>
<h3 id="heading-what-does-x-ua-compatible-mean">What does X-UA-Compatible mean?</h3>
<p>This <code>&lt;meta&gt;</code> tag specifies the document mode for Internet Explorer. <code>IE=edge</code> is the highest supported mode. </p>
<pre><code class="lang-html">    <span class="hljs-tag">&lt;<span class="hljs-name">meta</span> <span class="hljs-attr">http-equiv</span>=<span class="hljs-string">"X-UA-Compatible"</span> <span class="hljs-attr">content</span>=<span class="hljs-string">"ie=edge"</span>&gt;</span>
</code></pre>
<h3 id="heading-what-are-html-title-tags">What are HTML title tags?</h3>
<p>The <code>&lt;title&gt;</code> tag is the title for the web page. This text is shown in the browser's title bar.</p>
<pre><code class="lang-html">    <span class="hljs-tag">&lt;<span class="hljs-name">title</span>&gt;</span>HTML 5 Boilerplate<span class="hljs-tag">&lt;/<span class="hljs-name">title</span>&gt;</span>
</code></pre>
<p><img src="https://www.freecodecamp.org/news/content/images/2021/07/Screen-Shot-2021-07-30-at-4.15.25-AM.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h3 id="heading-css-stylesheet">CSS stylesheet</h3>
<p>This code will link your custom CSS to the HTML page.  <code>rel="stylesheet"</code> defines the relationship between the HTML file and the external stylesheet.  </p>
<pre><code class="lang-html">    <span class="hljs-tag">&lt;<span class="hljs-name">link</span> <span class="hljs-attr">rel</span>=<span class="hljs-string">"stylesheet"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"style.css"</span>&gt;</span>
</code></pre>
<h3 id="heading-script-tags-in-html">Script tags in HTML</h3>
<p>External script tags will be placed just before the ending body tag. This is where you can link your external JavaScript code. </p>
<pre><code class="lang-html">    <span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"index.js"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
</code></pre>
<h2 id="heading-conclusion">Conclusion</h2>
<p>You should add an HTML 5 boilerplate to each of your HTML pages. This starter code contains important information like the doctype, metadata, external stylesheets and script tags.   </p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ What is boilerplate and why do we use it? Necessity of coding style guide ]]>
                </title>
                <description>
                    <![CDATA[ By Meet Zaveri In Information Technology, a boilerplate is a unit of writing that can be reused over and over without change. By extension, the idea is sometimes applied to reusable programming, as in “boilerplate code.” Legal agreements, including s... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/whats-boilerplate-and-why-do-we-use-it-let-s-check-out-the-coding-style-guide-ac2b6c814ee7/</link>
                <guid isPermaLink="false">66c36635139b845d61e84bc8</guid>
                
                    <category>
                        <![CDATA[ boilerplate ]]>
                    </category>
                
                    <category>
                        <![CDATA[ freeCodeCamp.org ]]>
                    </category>
                
                    <category>
                        <![CDATA[ JavaScript ]]>
                    </category>
                
                    <category>
                        <![CDATA[ software development ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 02 Jan 2018 16:14:41 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*hrjnxp5fCjg2Hxv8IrImcg.png" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By Meet Zaveri</p>
<p>In Information Technology, a boilerplate is a unit of writing that can be reused over and over without change. By extension, the idea is sometimes applied to reusable programming, as in “boilerplate code.”</p>
<p>Legal agreements, including software and hardware terms and conditions, make abundant use of boilerplates.</p>
<p>For instance, a lawyer may give you a five page contract to sign, but most of the contract is boilerplate — meaning it’s the same for everyone who gets that contract, with only a few lines changed here and there.</p>
<p>In computer programming, <strong>boilerplate code</strong> or <strong>boilerplate</strong> refers to sections of code that have to be included in many places with little or no alteration. It is often used when referring to languages that are considered <em>verbose</em>, i.e. the programmer must write a lot of code to do minimal jobs.</p>
<p>For example, in web development, simple boilerplate for HTML would look like this:</p>
<pre><code>&lt;!DOCTYPE html&gt;                       &lt;html class="no-js" lang=""&gt;                           &lt;head&gt;                                 &lt;meta charset="utf-8"&gt;                                 &lt;meta http-equiv="x-ua-compatible" content="ie=edge"&gt;         &lt;title&gt;&lt;/title&gt;                                 &lt;meta name="description" content=""&gt;                           &lt;meta name="viewport" content="width=device-width, initial- scale=1, shrink-to-fit=no"&gt; &lt;link rel="stylesheet" href="css/main.css"&gt;&lt;/head&gt;                           &lt;body&gt;                                 &lt;p&gt;Hello world! This is HTML5 Boilerplate.&lt;/p&gt;               &lt;script src="js/vendor/modernizr-{{MODERNIZR_VERSION}}.min.js&gt;     &lt;/script&gt;
</code></pre><pre><code> &lt;<span class="hljs-regexp">/body&gt;&lt;/</span>html&gt;
</code></pre><p>You can view the whole repository here :</p>
<p><a target="_blank" href="https://github.com/h5bp/html5-boilerplate"><strong>h5bp/html5-boilerplate</strong></a><br><a target="_blank" href="https://github.com/h5bp/html5-boilerplate">_html5-boilerplate - A professional front-end template for building fast, robust, and adaptable web apps or sites._github.com</a></p>
<p>In the 1890s, boilerplate was actually cast or stamped in metal ready for the printing press and distributed to newspaper presses and firms around the United States. Until the 1950s, thousands of newspapers received and used this kind of boilerplate from the nation’s largest supplier, the Western Newspaper Union. Some companies also sent out press releases as boilerplate so that they had to be printed as written.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*QQnxLRyGkTqHamqONvrftA.png" alt="Image" width="500" height="375" loading="lazy"></p>
<p>Most professional web developers have created a collection of assets and snippets of code that they reuse on projects to accelerate development. There are some universal or near universal patterns that all websites share in common. Rather than continuously rebuild these, most developers start by copying the code they used for a similar project and then start modifying it.</p>
<p>Some developers recognize the value of these boilerplate starter templates and take the time to make the boilerplate more generic and share them online for others to use.</p>
<p>This is not only limited to web development. It is used beyond in AI/ML as there are more growing frameworks and libraries.</p>
<h4 id="heading-necessary-characteristics-of-boilerplate-for-large-projects-production-ready">Necessary characteristics of boilerplate for large projects (production ready)</h4>
<ul>
<li>Good and Readable Documentation ?</li>
<li>Code structure with a deeper abstraction level</li>
<li>Follows Proper Coding Standard</li>
<li>Has CLI tool (for rapid prototyping and setup)</li>
<li>Scalable ?</li>
<li>Easy testing tools</li>
<li>Necessary API modules</li>
<li>Support for Internationalization and Localization ?</li>
<li>Code Splitting</li>
<li>Server and Client code for setup</li>
<li>Proper Navigation and Routing Structure ?</li>
</ul>
<p>After all these minimum specs, you should start editing and altering the code in order to build your project.</p>
<p>There are some Big Tech Companies who even build their own boilerplate. They use it for respective and similar projects throughout time.</p>
<p>A perfect example for this would be react.js’s boilerplate:</p>
<p><a target="_blank" href="https://github.com/react-boilerplate/react-boilerplate"><strong>react-boilerplate/react-boilerplate</strong></a><br><a target="_blank" href="https://github.com/react-boilerplate/react-boilerplate">_react-boilerplate - :fire: A highly scalable, offline-first foundation with the best developer experience and a focus…_github.com</a></p>
<h4 id="heading-boilerplate-for-smaller-projectsscaffolding">Boilerplate for smaller projects(Scaffolding)</h4>
<p>These type of boilerplates are generally kind of “Starter Kits” or in professional way it is called “Scaffolding”. Their main target users are novice developers or new early adopters.</p>
<p>It focuses on fast prototyping by creating the elements which are necessary only for new projects. These require less functionality and are not scalable over time and project.</p>
<p>Their code structure is not much expanded, and doesn’t involve deeper abstraction layer as users only need to build core features. This eliminates the need for extra utilities.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*lfaRa-3SmkzcN2cuy3MCYw.png" alt="Image" width="800" height="330" loading="lazy">
<em>Code structure</em></p>
<p>The simplest example is Facebook’s create-react-app boilerplate:</p>
<p><a target="_blank" href="https://github.com/facebookincubator/create-react-app"><strong>facebookincubator/create-react-app</strong></a><br><a target="_blank" href="https://github.com/facebookincubator/create-react-app">_create-react-app - Create React apps with no build configuration._github.com</a></p>
<h3 id="heading-whats-the-difference-between-a-boilerplate-and-a-template">What’s the difference between a boilerplate and a template?</h3>
<p>As <a target="_blank" href="https://www.quora.com/profile/Joachim-Pense">Joachim Pense</a> clearly states, <strong>boilerplate</strong> is something that you copy and paste and just add to a document. It comes up most often in contracts where language is used and reused, spelling out things like conditions and caveats.</p>
<p>Writers use <strong>templates as models</strong>, sometimes with negative effects. In broad terms, a template is a model or pattern used to create new objects. In writing, it is a <strong>standardized form of something like a resume</strong> that writers can use to flesh out their own versions.</p>
<p>Unlike boilerplates, templates are adapted for a particular use. The problem arose for me when students used Word templates for their resumes, and they all ended up looking the same.</p>
<p>Both templates and boilerplates can make business writing stilted and artificial if used unwisely.</p>
<h3 id="heading-style-guide-for-writing-code">Style Guide for writing code</h3>
<p>Regardless of whether you’re using boilerplate or not, there are some standards followed by companies for writing code . One of them is <strong>Style Guide.</strong> It attempts to explain the basic styles and patterns that are used in various companies or organizations. It’s generally a rule that employees must adopt the coding style guide of their company.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*VHZwgapkhk1bMWHilZa6vw.png" alt="Image" width="781" height="342" loading="lazy"></p>
<p>The Style Guide describes tons of rules for writing code, like indentation of tabs and spaces, naming of variables and functions, writing necessary comments, formatting, source file structures, using proper method of data structures, avoiding hoisting, scoping, control statements and a lot more.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*hxP11Dbe9ksYpK5c8_nU3g.png" alt="Image" width="800" height="351" loading="lazy"></p>
<p>Programming styles commonly deal with the visual appearance of source code with the goal of readability. Software has long been available that formats source code automatically, leaving coders to concentrate on naming, logic, and higher techniques.</p>
<p>As a practical point, using a computer to format source code saves time, and it is possible to then enforce company-wide standards without <a target="_blank" href="https://en.wikipedia.org/wiki/Flaming_(Internet)#Holy_Wars">debates</a>. (Source — Wiki).</p>
<p>These are some common debates like: <strong>Tabs v Spaces Holy war</strong>, <strong>choosing the perfect Code IDE</strong>, and so on. The interesting thing is that you can get involved in these debates which mostly happen on <a target="_blank" href="https://www.reddit.com/r/programming/comments/2ban9r/the_great_white_space_debate/"><strong>Reddit</strong></a><strong>.</strong> You can also participate in some of the <a target="_blank" href="https://stackoverflow.com/"><strong>stackoverflow</strong></a> Q&amp;A’s.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*rjETUMQ62xAZegCSAglE6Q.png" alt="Image" width="800" height="571" loading="lazy">
_source — [https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/](https://stackoverflow.blog/2017/06/15/developers-use-spaces-make-money-use-tabs/" rel="noopener" target="<em>blank" title=")</em></p>
<p>For web developers, the most common style guide for JS is <strong>Airbnb’s javascript style guide.</strong> It’s open source and everyone can contribute.</p>
<p><a target="_blank" href="https://github.com/airbnb/javascript"><strong>airbnb/javascript</strong></a><br><a target="_blank" href="https://github.com/airbnb/javascript">_javascript - JavaScript Style Guide_github.com</a></p>
<p>If anyone is in doubt as to why Javascript needs a style guide, then read this issue’s second answer by <a target="_blank" href="https://twitter.com/hshoff">Harrison Shoff</a>, who is programmer at <strong>Airbnb</strong> .</p>
<p><a target="_blank" href="https://github.com/airbnb/javascript/issues/102"><strong>Why does JavaScript need a style guide? · Issue #102 · airbnb/javascript</strong></a><br><a target="_blank" href="https://github.com/airbnb/javascript/issues/102">_One of my favorite parts about the JavaScript community is that people choose to write it in so many different ways…_github.com</a></p>
<p>Here are some style guides for some of today’s more popular languages:</p>
<p><a target="_blank" href="https://github.com/dotnet/codeformatter"><strong>DotNet Code Formatter</strong></a></p>
<p><a target="_blank" href="https://github.com/google/google-java-format"><strong>Java: Google-Java-Format</strong></a></p>
<p><a target="_blank" href="https://standardjs.com"><strong>Javascript Standard Style</strong></a> <strong>(different from airbnb’s javascript)</strong></p>
<p><a target="_blank" href="http://cs.sensiolabs.org"><strong>PHP Coding Standards Fixe</strong>r</a></p>
<p><a target="_blank" href="https://github.com/google/yapf/"><strong>Python: Google’s YAPF</strong></a></p>
<p><a target="_blank" href="http://rubocop.readthedocs.io/en/latest/"><strong>Ruby: Rubocop</strong></a></p>
<h4 id="heading-more-from-boilerplate-concept-for-oop">More from Boilerplate: Concept for OOP</h4>
<p>In <a target="_blank" href="https://en.wikipedia.org/wiki/Object-oriented_programming">object-oriented programs</a>, classes are often provided with methods for <a target="_blank" href="https://en.wikipedia.org/wiki/Mutator_method">getting and setting</a> instance variables. The definitions of these methods can frequently be regarded as boilerplate.</p>
<p>Although the code will vary from one class to another, it is sufficiently stereotypical in structure that it would be better generated automatically than written by hand.</p>
<p>For example, in the following <a target="_blank" href="https://en.wikipedia.org/wiki/Java_(programming_language)">Java</a> class representing a pet, almost all the code is boilerplate except for the <a target="_blank" href="https://en.wikipedia.org/wiki/Declaration_(computer_science)">declarations</a> of <em>Pet</em>, <em>name</em>, and <em>owner</em>:</p>
<pre><code>public <span class="hljs-class"><span class="hljs-keyword">class</span> <span class="hljs-title">Pet</span> </span>{    private <span class="hljs-built_in">String</span> name;    private Person owner;
</code></pre><pre><code>public Pet(<span class="hljs-built_in">String</span> name, Person owner) {        <span class="hljs-built_in">this</span>.name = name;        <span class="hljs-built_in">this</span>.owner = owner;    }
</code></pre><pre><code>public <span class="hljs-built_in">String</span> getName() {        <span class="hljs-keyword">return</span> name;    }
</code></pre><pre><code>public <span class="hljs-keyword">void</span> setName(<span class="hljs-built_in">String</span> name) {        <span class="hljs-built_in">this</span>.name = name;    }
</code></pre><pre><code>public Person getOwner() {        <span class="hljs-keyword">return</span> owner;    }
</code></pre><pre><code>public <span class="hljs-keyword">void</span> setOwner(Person owner) {        <span class="hljs-built_in">this</span>.owner = owner;    }}
</code></pre><p>Boilerplate definition is becoming more global in many other programming languages nowadays. It comes from OOP and hybrid languages that were once procedural but have become OOP. They now have the same goal of repeating the code you build with a model/template/class/object, so they adopt this term. You make a template, and the only things you do for each instance of a template are the individual parameters.</p>
<p>This part is what we call boilerplate. You simply re-use the code you made a template of, but with different parameters.</p>
<h4 id="heading-boilerplate-as-an-api">Boilerplate as an API</h4>
<p>Since you’re simply re-using the template code with different parameters, this implies that we could build reusable API’s that only need a change of inputs and outputs.</p>
<h3 id="heading-conclusion">Conclusion</h3>
<p>“Boilerplate code” is any seemingly repetitive code that shows up again and again in order to get a result that seems like it ought to be much simpler.</p>
<p>I wrote this article because I was recently instructed by a Team Lead to learn about the many varieties of boilerplate that might be suitable for our project. So I had to go on a search for the perfect boilerplate.</p>
<p>Any type of feedback will be appreciated! Hustle On!</p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
