<?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[ bootstrap 4 - 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[ bootstrap 4 - freeCodeCamp.org ]]>
            </title>
            <link>https://www.freecodecamp.org/news/</link>
        </image>
        <generator>Eleventy</generator>
        <lastBuildDate>Wed, 03 Jun 2026 11:31:52 +0000</lastBuildDate>
        <atom:link href="https://www.freecodecamp.org/news/tag/bootstrap-4/rss.xml" rel="self" type="application/rss+xml" />
        <ttl>60</ttl>
        
            <item>
                <title>
                    <![CDATA[ Bootstrap Row Height ]]>
                </title>
                <description>
                    <![CDATA[ Bootstrap is one of the fastest ways to, well, bootstrap a project. The library includes a lot of helpful CSS utility classes to get a responsive, mobile first layout up and running quickly. But what if you start adding your own CSS rules to the mix,... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/bootstrap-row-height/</link>
                <guid isPermaLink="false">66c346338ced2460cf9e9b54</guid>
                
                    <category>
                        <![CDATA[ Bootstrap ]]>
                    </category>
                
                    <category>
                        <![CDATA[ bootstrap 4 ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 02 Jun 2020 02:18:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9a99740569d1a4ca2690.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>Bootstrap is one of the fastest ways to, well, bootstrap a project. The library includes a lot of helpful CSS utility classes to get a responsive, mobile first layout up and running quickly.</p>
<p>But what if you start adding your own CSS rules to the mix, but they don't seem to have any affect on the layout? Is it Bootstrap overwriting your styles? Or something else?</p>
<p>For example, say you want to increase the height of a row, and also resize and image.</p>
<p>Here is your HTML:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"divheight"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"row bg-info text-white"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-sm-2 align-middle"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"https://static-cdn.jtvnw.net/jtv_user_pictures/freecodecamp-profile_image-d9514f2df0962329-300x300.png"</span> &lt;/<span class="hljs-attr">img</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-sm-3 align-middle"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">label</span>&gt;</span>freecodecamp<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-sm-7 align-middle"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">label</span>&gt;</span>Greg working on Electron-Vue boilerplate w/ Akira #programming #vuejs #electron<span class="hljs-tag">&lt;/<span class="hljs-name">label</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>And CSS:</p>
<pre><code class="lang-css"><span class="hljs-selector-id">#divheight</span> {
  <span class="hljs-attribute">heights</span>: <span class="hljs-number">120px</span>;
}

<span class="hljs-selector-tag">img</span> {
  <span class="hljs-attribute">width</span>: <span class="hljs-number">50px</span>;
  <span class="hljs-attribute">height</span>: <span class="hljs-number">50px</span>;
}
</code></pre>
<p>The problem is that, for some reason, the height of the row is 50px like the image, not 120px:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/image-47.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-solution">Solution</h2>
<p>There are a couple of reasons this is happening. First, did you notice the typo above?</p>
<p>Fix that and your CSS will look like this:</p>
<pre><code class="lang-css"><span class="hljs-selector-id">#divheight</span> {
  <span class="hljs-attribute">height</span>: <span class="hljs-number">120px</span>;
}

<span class="hljs-selector-tag">img</span> {
  <span class="hljs-attribute">width</span>: <span class="hljs-number">50px</span>;
  <span class="hljs-attribute">height</span>: <span class="hljs-number">50px</span>;
}
</code></pre>
<p>But your row still isn't 120px. If you inspect <code>#divheight</code>, you'll see that it's just under 120px:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/image-48.png" alt="Image" width="600" height="400" loading="lazy"></p>
<p>Instead of targeting <code>#divheight</code>, go down to the next <code>div</code> element and target the class <code>row</code>:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.row</span> {
  <span class="hljs-attribute">height</span>: <span class="hljs-number">120px</span>;
}

<span class="hljs-selector-tag">img</span> {
  <span class="hljs-attribute">width</span>: <span class="hljs-number">50px</span>;
  <span class="hljs-attribute">height</span>: <span class="hljs-number">50px</span>;
}
</code></pre>
<p>Then the row will be 120px like you expect:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/image-49.png" alt="Image" width="600" height="400" loading="lazy"></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Bootstrap 4: How to Make Top Fixed Navbar Stay in Container and Not Stretch? ]]>
                </title>
                <description>
                    <![CDATA[ There are many ways to make a fixed navbar stay inside a parent's div container. We'll go over the most straightforward one here. Imagine you have the following code, modified slightly from the Bootstrap docs: <div class="container">   <nav class="na... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/bootstrap-4-how-to-make-top-fixed-navbar-stay-in-container-and-not-stretch/</link>
                <guid isPermaLink="false">66c34631d48c8b932b406b16</guid>
                
                    <category>
                        <![CDATA[ Bootstrap ]]>
                    </category>
                
                    <category>
                        <![CDATA[ bootstrap 4 ]]>
                    </category>
                
                    <category>
                        <![CDATA[ toothbrush ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Tue, 02 Jun 2020 02:17:00 +0000</pubDate>
                <media:content url="https://cdn-media-2.freecodecamp.org/w1280/5f9c9a9e740569d1a4ca26b6.jpg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>There are many ways to make a fixed navbar stay inside a parent's <code>div</code> container. We'll go over the most straightforward one here.</p>
<p>Imagine you have the following code, modified slightly from the <a target="_blank" href="https://v4-alpha.getbootstrap.com/components/navbar/#collapsible-content">Bootstrap docs</a>:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">nav</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar navbar-fixed-top navbar-inverse bg-inverse"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-toggler hidden-lg-up"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"button"</span> <span class="hljs-attr">data-toggle</span>=<span class="hljs-string">"collapse"</span> <span class="hljs-attr">data-target</span>=<span class="hljs-string">"#navbarResponsive"</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">"navbarResponsive"</span> <span class="hljs-attr">aria-expanded</span>=<span class="hljs-string">"false"</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">"Toggle navigation"</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"collapse navbar-toggleable-md"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"navbarResponsive"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-brand"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">""</span> <span class="hljs-attr">width</span>=<span class="hljs-string">"30"</span> <span class="hljs-attr">height</span>=<span class="hljs-string">"30"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"d-inline-block align-top"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">""</span>&gt;</span>Navbar
      <span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">ul</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav navbar-nav float-md-right"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item active"</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>Home
            <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"sr-only"</span>&gt;</span>(current)<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
          <span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>Link<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
          <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>Link<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
      <span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"next"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  hello
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span><span class="hljs-selector-class">.next</span> {
  <span class="hljs-attribute">background-color</span>: lightblue;
  <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>;
  <span class="hljs-attribute">height</span>: <span class="hljs-number">60rem</span>;
}
</code></pre>
<p>And your page looks like this:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/1.png" alt="Image" width="600" height="400" loading="lazy"></p>
<h2 id="heading-solutions">Solutions</h2>
<p>While the docs read "Navbars and their contents are fluid by default. Use optional containers to limit their horizontal width," the easiest solution is to use CSS to set the width of the navbar directly:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">div</span><span class="hljs-selector-class">.next</span> {
  <span class="hljs-attribute">background-color</span>: lightblue;
  <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>;
  <span class="hljs-attribute">height</span>: <span class="hljs-number">60rem</span>;
}

<span class="hljs-selector-class">.container</span> {
  <span class="hljs-attribute">padding</span>: <span class="hljs-number">0px</span>;
}

<span class="hljs-selector-tag">nav</span><span class="hljs-selector-class">.navbar</span> {
  <span class="hljs-attribute">width</span>: inherit;
  <span class="hljs-attribute">top</span>: <span class="hljs-number">0%</span>;
  <span class="hljs-attribute">left</span>: <span class="hljs-number">50%</span>;
  <span class="hljs-attribute">transform</span>: <span class="hljs-built_in">translateX</span>(-<span class="hljs-number">50%</span>);
}
</code></pre>
<p>By adding rules targeting <code>.container</code> and <code>nav.navbar</code>, your navbar is now the same width as the parent's container:</p>
<p><img src="https://www.freecodecamp.org/news/content/images/2020/06/image-46.png" alt="Image" width="600" height="400" loading="lazy"></p>
 ]]>
                </content:encoded>
            </item>
        
            <item>
                <title>
                    <![CDATA[ Learn Bootstrap 4 in 30 minutes by building a landing page website ]]>
                </title>
                <description>
                    <![CDATA[ By SaidHayani@ A guide for beginners “Bootstrap is a free, open-source front-end library for designing websites and web applications. It contains HTML- and CSS-based design templates for everything from typography, forms, buttons, navigation and ot... ]]>
                </description>
                <link>https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/</link>
                <guid isPermaLink="false">66c3599ff83dfae169b2c004</guid>
                
                    <category>
                        <![CDATA[ bootstrap 4 ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Design ]]>
                    </category>
                
                    <category>
                        <![CDATA[ front end ]]>
                    </category>
                
                    <category>
                        <![CDATA[ tech  ]]>
                    </category>
                
                    <category>
                        <![CDATA[ Web Development ]]>
                    </category>
                
                <dc:creator>
                    <![CDATA[ freeCodeCamp ]]>
                </dc:creator>
                <pubDate>Sat, 17 Feb 2018 19:31:55 +0000</pubDate>
                <media:content url="https://cdn-media-1.freecodecamp.org/images/1*1_a4TocueD3AqEpsDDv4bA.jpeg" medium="image" />
                <content:encoded>
                    <![CDATA[ <p>By SaidHayani@</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*a9OoxPsn-hrbjYpbNV6DzA.gif" alt="Image" width="579" height="286" loading="lazy"></p>
<h3 id="heading-a-guide-for-beginners">A guide for beginners</h3>
<blockquote>
<p>“Bootstrap is a free, open-source front-end library for designing websites and web applications. It contains HTML- and CSS-based design templates for everything from typography, forms, buttons, navigation and other interface components as well as JavaScript extensions. Unlike many other web frameworks, Bootstrap concerns itself with front-end development only.” — [Wikipedia](https://en.wikipedia.org/wiki/Bootstrap_(front-end_framework)</p>
<p><a target="_blank" href="https://skl.sh/2NbSAYj">Hi, before we start check out my full class to learn Bootstrap 4 ,where you will learn new features of bootstrap and how to use them to build better user experiences</a> .</p>
</blockquote>
<p>There are many versions of Bootstrap with version 4 being the latest. In this article, we are going to build a website using Bootstrap 4.</p>
<h3 id="heading-prerequisites">Prerequisites</h3>
<p>Before starting, there are some skills you’ll have to know in order to learn and use the Bootstrap framework:</p>
<ul>
<li>HTML fundamentals</li>
<li>basic knowledge of CSS</li>
<li>and some basic JQuery</li>
</ul>
<h3 id="heading-table-of-contents">Table of Contents</h3>
<p>We will cover the topics below while building the website:</p>
<ul>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#downloading-and-installing-bootstrap-4">Downloading and installing Bootstrap 4</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#the-new-features-of-bootstrap-4">The new features of Bootstrap 4</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#bootstrap-grid-system">Bootstrap Grid system</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#navbar">Navbar</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#header">Header</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#buttons">Buttons</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#about-section">About Section</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#portfolio-section">Portfolio Section</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#blog-section">Blog Section</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#cards">Cards</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#team-section">Team Section</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#contact-form">Contact Form</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#fonts">Fonts</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#scroll-effect">Scroll Effect</a></li>
<li><a target="_blank" href="https://www.freecodecamp.org/news/learn-bootstrap-4-in-30-minute-by-building-a-landing-page-website-guide-for-beginners-f64e03833f33/#wrap-up-and-conclusion">Wrap-up and Conclusion</a></li>
</ul>
<h3 id="heading-downloading-and-installing-bootstrap-4">Downloading and installing Bootstrap 4</h3>
<p>There are three ways to install and include Bootstrap 4 for your project:</p>
<ol>
<li>Use npm</li>
</ol>
<p>You can install Bootstrap 4 by running this command <code>npm install bootstrap</code></p>
<ol start="2">
<li>Use a Content Delivery Network (CDN)</li>
</ol>
<p>By including this link in your project between head tags:</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">"https://maxcdn.bootstrapcdn.com/bootstrap/4.0.0/css/bootstrap.min.css"</span> <span class="hljs-attr">integrity</span>=<span class="hljs-string">"sha384-Gn5384xqQ1aoWXA+058RXPxPg6fy4IWvTNh0E263XmFcJlSAwiGgFAW/dAiS6JXm"</span> <span class="hljs-attr">crossorigin</span>=<span class="hljs-string">"anonymous"</span>&gt;</span>
</code></pre>
<ol start="3">
<li>Download the <a target="_blank" href="http://getbootstrap.com/">Bootstrap 4</a> library and use it locally.</li>
</ol>
<p>The structure of our project should look like this:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*cyhB-vVWlIwbNpDH_JNZYg.png" alt="Image" width="800" height="507" loading="lazy"></p>
<h3 id="heading-the-new-features-of-bootstrap-4">The new features of Bootstrap 4</h3>
<p>What’s new in Bootstrap 4? And what’s different between Bootstrap 3 and 4?</p>
<p>Bootstrap 4 now comes with some awesome features that didn’t exist in the last version:</p>
<ul>
<li>Bootstrap 4 is written using Flexbox Grid, whereas Bootstrap 3 was written using the float method.<br>If you’re new to Flexbox then check out <a target="_blank" href="https://scrimba.com/p/pL65cJ/canLGCw">this tutorial</a>.</li>
<li>Bootstrap 4 uses <code>rem</code> CSS units whereas Bootstrap 3 uses <code>px</code>.<br><a target="_blank" href="https://zellwk.com/blog/media-query-units/">See how these two units differ.</a></li>
<li>Panels, thumbnails, and wells have been dropped entirely.<br>You can read in detail more about the global changes and removed features of Bootstrap 4 <a target="_blank" href="http://getbootstrap.com/docs/4.0/migration/#global-changes">here</a>.</li>
</ul>
<p>Without jumping too deep into detail here, let’s move on to some other important things.</p>
<h3 id="heading-the-bootstrap-grid-system">The Bootstrap Grid system</h3>
<p>The Bootstrap Grid system helps you to create your layout and easily build a responsive website. There have not been any changes in the class names, except the <code>.xs</code> class, which no longer exists in Bootstrap 4.</p>
<p>The grid is divided into 12 columns, so your layout will be based on this.</p>
<p>To use the grid system you’ll have to add a <code>.row</code> class to the main <em>div</em>.</p>
<pre><code class="lang-html">col-lg-2 // class used for large devices like laptops
col-md-2 // class used for medium devices like tablets
col-sm-2// class used for small devices like mobile phones
</code></pre>
<h3 id="heading-navbar">Navbar</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*VbIQyNsPrZ143nV8LaHLAg.png" alt="Image" width="800" height="164" loading="lazy"></p>
<p>The navbar wrapper is pretty cool in Bootstrap 4. It’s so helpful when it comes to building a responsive navbar.</p>
<p>To get it, we are going to add the <code>navbar</code> class to our <code>**index.html**</code> file:</p>
<pre><code class="lang-html"><span class="hljs-comment">&lt;!-- navbar --&gt;</span>  
 <span class="hljs-tag">&lt;<span class="hljs-name">nav</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar navbar-expand-lg fixed-top "</span>&gt;</span>  
 <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-brand"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>Home<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-toggler"</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"button"</span> <span class="hljs-attr">data-toggle</span>=<span class="hljs-string">"collapse"</span> <span class="hljs-attr">data-target</span>=<span class="hljs-string">"#navbarSupportedContent"</span> <span class="hljs-attr">aria-controls</span>=<span class="hljs-string">"navbarSupportedContent"</span> <span class="hljs-attr">aria-expanded</span>=<span class="hljs-string">"false"</span> <span class="hljs-attr">aria-label</span>=<span class="hljs-string">"Toggle navigation"</span>&gt;</span>  
 <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-toggler-icon"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"collapse navbar-collapse "</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"navbarSupportedContent"</span>&gt;</span>     <span class="hljs-tag">&lt;<span class="hljs-name">ul</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"navbar-nav mr-4"</span>&gt;</span>
 <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span> <span class="hljs-attr">data-value</span>=<span class="hljs-string">"about"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>About<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>        <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>  
<span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link "</span> <span class="hljs-attr">data-value</span>=<span class="hljs-string">"portfolio"</span><span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>Portfolio<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>    
 <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
 <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span> 
    <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link "</span> <span class="hljs-attr">data-value</span>=<span class="hljs-string">"blog"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>Blog<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>         <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>   
<span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>  
   <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link "</span> <span class="hljs-attr">data-value</span>=<span class="hljs-string">"team"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>         Team<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>       <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>  
<span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span> 
 <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link "</span> <span class="hljs-attr">data-value</span>=<span class="hljs-string">"contact"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>Contact<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>       <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span> 
<span class="hljs-tag">&lt;/<span class="hljs-name">ul</span>&gt;</span> 
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">nav</span>&gt;</span>
</code></pre>
<div class="embed-wrapper"><iframe src="https://codesandbox.io/embed/38nnqwl8n6?fontsize=14" style="width:100%;height:500px;border:0;border-radius:4px;overflow:hidden" sandbox="allow-modals allow-forms allow-popups allow-scripts allow-same-origin" title="Embedded content" loading="lazy"></iframe></div>

<p>Create and include a <code>**main.css**</code> file so that you can customize the CSS style.</p>
<p>Put this within the <code>head</code> tag in your <code>**index.html**</code> file:</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">type</span>=<span class="hljs-string">"text/css"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"css/main.css"</span>&gt;</span>
</code></pre>
<p>Let’s add some colors to our navbar:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.navbar</span>{ <span class="hljs-attribute">background</span>:<span class="hljs-number">#F97300</span>;}

<span class="hljs-selector-class">.nav-link</span> , <span class="hljs-selector-class">.navbar-brand</span>{ <span class="hljs-attribute">color</span>: <span class="hljs-number">#f4f4f4</span>; <span class="hljs-attribute">cursor</span>: pointer;}

<span class="hljs-selector-class">.nav-link</span>{ <span class="hljs-attribute">margin-right</span>: <span class="hljs-number">1em</span> <span class="hljs-meta">!important</span>;}

<span class="hljs-selector-class">.nav-link</span><span class="hljs-selector-pseudo">:hover</span>{ <span class="hljs-attribute">background</span>: <span class="hljs-number">#f4f4f4</span>; <span class="hljs-attribute">color</span>: <span class="hljs-number">#f97300</span>; }

<span class="hljs-selector-class">.navbar-collapse</span>{ <span class="hljs-attribute">justify-content</span>: flex-end;}

<span class="hljs-selector-class">.navbar-toggler</span>{  <span class="hljs-attribute">background</span>:<span class="hljs-number">#fff</span> <span class="hljs-meta">!important</span>;}
</code></pre>
<p>The new Bootstrap Grid is built with the Flexbox system, so for alignment, you have to use a Flexbox property. For example, to place the navbar menu on the right we need to add a <code>justify-content</code> property and set it to <code>flex-end</code>.</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.navbar-collapse</span>{
 <span class="hljs-attribute">justify-content</span>: flex-end;
}
</code></pre>
<p>Add the <code>.fixed-top</code> class to the navbar to give it a fixed position.</p>
<p>To make the navbar background color light, add <code>.bg-light</code>. For a dark background, add <code>.bg-dark</code>, and for a light blue background, add<br><code>.bg-primary</code>.</p>
<p>Here’s how that should look:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.bg-dark</span>{
<span class="hljs-attribute">background-color</span>:<span class="hljs-number">#343a40</span><span class="hljs-meta">!important</span>
}
<span class="hljs-selector-class">.bg-primary</span>{
<span class="hljs-attribute">background-color</span>:<span class="hljs-number">#007bff</span><span class="hljs-meta">!important</span>
}
</code></pre>
<h3 id="heading-header">Header</h3>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">header</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"header"</span>&gt;</span>

<span class="hljs-tag">&lt;/<span class="hljs-name">header</span>&gt;</span>
</code></pre>
<p>Let’s try and create a layout for the header.</p>
<p>Here, we want to make sure the header takes up the window’s height so we are going to use a little <code>JQuery</code> code.</p>
<p>First, create a file named <code>**main.js**</code> and include it in the <code>**index.html**</code> file before the closing <code>body</code> tag:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">script</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text/javascript"</span> <span class="hljs-attr">src</span>=<span class="hljs-string">'js/main.js'</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">script</span>&gt;</span>
</code></pre>
<p>In the <code>main.js</code> file insert this a little code of JQuery<em>:</em></p>
<pre><code class="lang-js">$(<span class="hljs-built_in">document</span>).ready(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{
 $(<span class="hljs-string">'.header'</span>).height($(<span class="hljs-built_in">window</span>).height());

})
</code></pre>
<p>It’d be pretty cool if we set a nice background image to the header:</p>
<pre><code class="lang-css"><span class="hljs-comment">/*header style*/</span>
<span class="hljs-selector-class">.header</span>{
 <span class="hljs-attribute">background-image</span>: <span class="hljs-built_in">url</span>(<span class="hljs-string">'../images/headerback.jpg'</span>);
 <span class="hljs-attribute">background-attachment</span>: fixed;
 <span class="hljs-attribute">background-size</span>: cover;
 <span class="hljs-attribute">background-position</span>: center;
}
</code></pre>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*LmLTI-enV2RSKjsO9hzPxQ.png" alt="Image" width="800" height="395" loading="lazy"></p>
<p>Let’s add an overlay to make the header look a bit more professional:</p>
<p>Add this to your <code>**index.html**</code> file:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">header</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"header"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"overlay"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">header</span>&gt;</span>
</code></pre>
<p>Then, add this to your <code>**main.css**</code> file:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.overlay</span>{
 <span class="hljs-attribute">position</span>: absolute;
 <span class="hljs-attribute">min-height</span>: <span class="hljs-number">100%</span>;
 <span class="hljs-attribute">min-width</span>: <span class="hljs-number">100%</span>;
 <span class="hljs-attribute">left</span>: <span class="hljs-number">0</span>;
 <span class="hljs-attribute">top</span>: <span class="hljs-number">0</span>;
 <span class="hljs-attribute">background</span>: <span class="hljs-built_in">rgba</span>(<span class="hljs-number">244</span>, <span class="hljs-number">244</span>, <span class="hljs-number">244</span>, <span class="hljs-number">0.79</span>);
}
</code></pre>
<p>Now we have to add a description inside the header.</p>
<p>To wrap our description we’re first going to create a <code>div</code> and give it a class <code>.container</code>.</p>
<p><code>.container</code> is a Bootstrap class that will help you to wrap your content and make your layout more responsive:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">header</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"header"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"overlay"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>

   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

<span class="hljs-tag">&lt;/<span class="hljs-name">header</span>&gt;</span>
</code></pre>
<p>Then, add another <code>div</code> which will contain the description.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"description "</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>    Hello ,Welcome To My official Website
    <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>    cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non    proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
<span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>   
 <span class="hljs-tag">&lt;<span class="hljs-name">button</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"btn btn-outline-secondary btn-lg"</span>&gt;</span>See more<span class="hljs-tag">&lt;/<span class="hljs-name">button</span>&gt;</span>   <span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>  
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>We’ll give it a class of <code>.description</code> and add the <code>.text-center</code> class to make sure the content is placed in the center of the page.</p>
<h4 id="heading-buttons">Buttons</h4>
<p>Add the class <code>.btn btn-outline-secondary</code> to the <code>button</code> element. there are many other Bootstrap classes for buttons.</p>
<p>Check some examples:</p>
<p><a target="_blank" href="https://codepen.io/Saidalmaghribi/embed/oEWgbw"><strong>CodePen Embed — buttons in Bootstrap 4</strong></a><br><a target="_blank" href="https://codepen.io/Saidalmaghribi/embed/oEWgbw">_Buttons Button primary Button default Button danger Button info Button warning Button dark Button success Buttons…_codepen.io</a></p>
<p>Here’s how the styling for the <code>.description</code> looks in the <code>**main.css**</code> file:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.description</span>{
    <span class="hljs-attribute">position</span>: absolute;
    <span class="hljs-attribute">top</span>: <span class="hljs-number">30%</span>;
    <span class="hljs-attribute">margin</span>: auto;
    <span class="hljs-attribute">padding</span>: <span class="hljs-number">2em</span>;

}
<span class="hljs-selector-class">.description</span> <span class="hljs-selector-tag">h1</span>{
 <span class="hljs-attribute">color</span>:<span class="hljs-number">#F97300</span> ;
}
<span class="hljs-selector-class">.description</span> <span class="hljs-selector-tag">p</span>{
 <span class="hljs-attribute">color</span>:<span class="hljs-number">#666</span>;
 <span class="hljs-attribute">font-size</span>: <span class="hljs-number">20px</span>;
 <span class="hljs-attribute">width</span>: <span class="hljs-number">50%</span>;
 <span class="hljs-attribute">line-height</span>: <span class="hljs-number">1.5</span>;
}
<span class="hljs-selector-class">.description</span> <span class="hljs-selector-tag">button</span>{
 <span class="hljs-attribute">border</span>:<span class="hljs-number">1px</span>  solid <span class="hljs-number">#F97300</span>;
 <span class="hljs-attribute">background</span>:<span class="hljs-number">#F97300</span>;
 <span class="hljs-attribute">color</span>:<span class="hljs-number">#fff</span>;
}
</code></pre>
<p>After all of that, our header will look like this:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*kV7umhOF5QPveMmADXUCSw.png" alt="Image" width="800" height="402" loading="lazy"></p>
<p>Cool isn’t :).</p>
<h3 id="heading-about-section">About Section</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*VWnyo3Jg4brsW5YRZToCiQ.png" alt="Image" width="800" height="354" loading="lazy"></p>
<p>In this section, we will use some Bootstrap Grid to divide the section into two parts.</p>
<p>To start our grid, we have to assign the <code>.row</code> class to the parent <code>div</code>.</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"row"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>The first section will be on the left and will contain a picture, the second section will be on the right and contain a description.</p>
<p>Each <code>div</code> will take up 6 columns — that means half of the section. Remember that a grid is divided into 12 columns.</p>
<p>In the first <code>div</code> on the left side:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"row"</span>&gt;</span> 
 // left side
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/team-3.jpg"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-justify"</span>&gt;</span>S.Web Developer<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
 <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>After adding the the HTML elements on the right-side, the structure of the code will look like this:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"row"</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/team-3.jpg"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-justify"</span>&gt;</span>S.Web Developer<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-8 col-md-8 col-sm-12 desc"</span>&gt;</span>

    <span class="hljs-tag">&lt;<span class="hljs-name">h3</span>&gt;</span>D.John<span class="hljs-tag">&lt;/<span class="hljs-name">h3</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">p</span>&gt;</span>
       ipsum dolor sit amet, consectetur adipisicing elit, sed do eiusmod
     tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam,
     quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo
     consequat. Duis aute irure dolor in reprehenderit in voluptate velit esse
     cillum dolore eu fugiat nulla pariatur. Excepteur sint occaecat cupidatat non
     proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
    <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>Here’s how I’ve made it look:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.about</span>{
 <span class="hljs-attribute">margin</span>: <span class="hljs-number">4em</span> <span class="hljs-number">0</span>;
 <span class="hljs-attribute">padding</span>: <span class="hljs-number">1em</span>;
 <span class="hljs-attribute">position</span>: relative;
}
<span class="hljs-selector-class">.about</span> <span class="hljs-selector-tag">h1</span>{
 <span class="hljs-attribute">color</span>:<span class="hljs-number">#F97300</span>;
 <span class="hljs-attribute">margin</span>: <span class="hljs-number">2em</span>;
}
<span class="hljs-selector-class">.about</span> <span class="hljs-selector-tag">img</span>{
 <span class="hljs-attribute">height</span>: <span class="hljs-number">100%</span>;
    <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>;
    <span class="hljs-attribute">border-radius</span>: <span class="hljs-number">50%</span>
}
<span class="hljs-selector-class">.about</span> <span class="hljs-selector-tag">span</span>{
 <span class="hljs-attribute">display</span>: block;
 <span class="hljs-attribute">color</span>: <span class="hljs-number">#888</span>;
 <span class="hljs-attribute">position</span>: absolute;
 <span class="hljs-attribute">left</span>: <span class="hljs-number">115px</span>;
}
<span class="hljs-selector-class">.about</span> <span class="hljs-selector-class">.desc</span>{
 <span class="hljs-attribute">padding</span>: <span class="hljs-number">2em</span>;
 <span class="hljs-attribute">border-left</span>:<span class="hljs-number">4px</span> solid <span class="hljs-number">#10828C</span>;
}
<span class="hljs-selector-class">.about</span> <span class="hljs-selector-class">.desc</span> <span class="hljs-selector-tag">h3</span>{
 <span class="hljs-attribute">color</span>: <span class="hljs-number">#10828C</span>;
}
<span class="hljs-selector-class">.about</span> <span class="hljs-selector-class">.desc</span> <span class="hljs-selector-tag">p</span>{
 <span class="hljs-attribute">line-height</span>:<span class="hljs-number">2</span>;
 <span class="hljs-attribute">color</span>:<span class="hljs-number">#888</span>;
}
</code></pre>
<h3 id="heading-portfolio-section">Portfolio Section</h3>
<p>Now, let’s move onto the next bit and make a portfolio section that will contain a gallery.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*fNaqxcagCvh8Ue3lZvK6Vw.png" alt="Image" width="800" height="365" loading="lazy"></p>
<p>The structure of our HTML code for the Portfolio section looks like this:</p>
<pre><code class="lang-html"><span class="hljs-comment">&lt;!-- portfolio --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"portfolio"</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-center"</span>&gt;</span>Portfolio<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
 <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"row"</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/portfolio/port13.png"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/portfolio/port1.png"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/portfolio/port6.png"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/portfolio/port3.png"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/portfolio/port11.png"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/portfolio/electric.png"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/portfolio/Classic.jpg"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/portfolio/port1.png"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/portfolio/port8.png"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
 <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>Adding <code>.img-fluid</code> to each image to makes it responsive.</p>
<p>Each item in our gallery will take up 4 columns (remember, <code>col-md-4</code> for medium devices, <code>col-lg-4</code> for large devices). That’s equal to 33.33333% on large devices such desktops and large tablets, and 12 columns on a small device (like iPhone, mobile devices) will take up 100% of the container.</p>
<p>Let’s add some styling to our Gallery:</p>
<pre><code class="lang-css"><span class="hljs-comment">/*Portfolio*/</span>
<span class="hljs-selector-class">.portfolio</span>{
 <span class="hljs-attribute">margin</span>: <span class="hljs-number">4em</span> <span class="hljs-number">0</span>;
    <span class="hljs-attribute">position</span>: relative; 
}
<span class="hljs-selector-class">.portfolio</span> <span class="hljs-selector-tag">h1</span>{
 <span class="hljs-attribute">color</span>:<span class="hljs-number">#F97300</span>;
 <span class="hljs-attribute">margin</span>: <span class="hljs-number">2em</span>; 
}
<span class="hljs-selector-class">.portfolio</span> <span class="hljs-selector-tag">img</span>{
  <span class="hljs-attribute">height</span>: <span class="hljs-number">15rem</span>;
  <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>;
  <span class="hljs-attribute">margin</span>: <span class="hljs-number">1em</span>;

}
</code></pre>
<h3 id="heading-blog-section"><strong>Blog Section</strong></h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*3y9bIjRwf2RtGRzMIXwZIQ.png" alt="Image" width="800" height="357" loading="lazy"></p>
<h4 id="heading-cards">Cards</h4>
<p>Cards in Bootstrap 4 make blog design so much easier. The cards are appropriate for articles and posts.</p>
<p>To create a card, we use the class <code>.card</code> and assign it to a <em>div</em> element,</p>
<p>The card class contains many features:</p>
<ul>
<li><code>.card-header</code>: define the card header</li>
<li><code>.card-body</code>: for the card body</li>
<li><code>.card-title</code>: the title of the card</li>
<li><code>card-footer</code>: define the footer of the card.</li>
<li><code>.card-image</code>: for the card’s image</li>
</ul>
<p>So, our website’s HTML should now look something like this:</p>
<pre><code class="lang-html"><span class="hljs-comment">&lt;!-- Posts section --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"blog"</span>&gt;</span>
 <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>
 <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-center"</span>&gt;</span>Blog<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"row"</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-md-4 col-lg-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card"</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-img"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/posts/polit.jpg"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

     <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-body"</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">h4</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-title"</span>&gt;</span>Post Title<span class="hljs-tag">&lt;/<span class="hljs-name">h4</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-text"</span>&gt;</span>

       proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
      <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-footer"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">""</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-link"</span>&gt;</span>Read more<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-md-4 col-lg-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card"</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-img"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/posts/images.jpg"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

     <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-body"</span>&gt;</span>
        <span class="hljs-tag">&lt;<span class="hljs-name">h4</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-title"</span>&gt;</span>Post Title<span class="hljs-tag">&lt;/<span class="hljs-name">h4</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-text"</span>&gt;</span>

       proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
      <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-footer"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">""</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-link"</span>&gt;</span>Read more<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-md-4 col-lg-4 col-sm-12"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card"</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-img"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/posts/imag2.jpg"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span>&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>

     <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-body"</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">h4</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-title"</span>&gt;</span>Post Title<span class="hljs-tag">&lt;/<span class="hljs-name">h4</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">p</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-text"</span>&gt;</span>

       proident, sunt in culpa qui officia deserunt mollit anim id est laborum.
      <span class="hljs-tag">&lt;/<span class="hljs-name">p</span>&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-footer"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">href</span>=<span class="hljs-string">""</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"card-link"</span>&gt;</span>Read more<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
 <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>We need to add some CSS style to the cards:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.blog</span>{
 <span class="hljs-attribute">margin</span>: <span class="hljs-number">4em</span> <span class="hljs-number">0</span>;
 <span class="hljs-attribute">position</span>: relative; 
}
<span class="hljs-selector-class">.blog</span> <span class="hljs-selector-tag">h1</span>{
 <span class="hljs-attribute">color</span>:<span class="hljs-number">#F97300</span>;
 <span class="hljs-attribute">margin</span>: <span class="hljs-number">2em</span>; 
}
<span class="hljs-selector-class">.blog</span> <span class="hljs-selector-class">.card</span>{
 <span class="hljs-attribute">box-shadow</span>: <span class="hljs-number">0</span> <span class="hljs-number">0</span> <span class="hljs-number">20px</span> <span class="hljs-number">#ccc</span>;
}
<span class="hljs-selector-class">.blog</span> <span class="hljs-selector-class">.card</span> <span class="hljs-selector-tag">img</span>{
 <span class="hljs-attribute">width</span>: <span class="hljs-number">100%</span>;
 <span class="hljs-attribute">height</span>: <span class="hljs-number">12em</span>;
}
<span class="hljs-selector-class">.blog</span> <span class="hljs-selector-class">.card-title</span>{
 <span class="hljs-attribute">color</span>:<span class="hljs-number">#F97300</span>;

}
<span class="hljs-selector-class">.blog</span> <span class="hljs-selector-class">.card-body</span>{
 <span class="hljs-attribute">padding</span>: <span class="hljs-number">1em</span>;
}
</code></pre>
<p>After adding the Blog section to our website, the design should now look something like this:</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*mHMPSea2jWdZ2dc_b658eA.png" alt="Image" width="800" height="1799" loading="lazy"></p>
<p>Cool isn’t it? ?</p>
<h3 id="heading-team-section"><strong>Team Section</strong></h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*1PaKtdHChKl534aExUfjCQ.png" alt="Image" width="800" height="322" loading="lazy"></p>
<p>In this section we will use the grid system to distribute even space between images. Each image takes up 3 columns (<code>**.col-md-3**</code>) of the container — that equals 25% of the total space.</p>
<p>Our HTML structure:</p>
<pre><code class="lang-html"><span class="hljs-comment">&lt;!-- Team section --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"team"</span>&gt;</span>
 <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">h1</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-center"</span>&gt;</span>Our Team<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"row"</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-3 col-md-3 col-sm-12 item"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/team-2.jpg"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"team"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"des"</span>&gt;</span>
      Sara
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-muted"</span>&gt;</span>Manager<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-3 col-md-3 col-sm-12 item"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/team-3.jpg"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"team"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"des"</span>&gt;</span>
       Chris
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-muted"</span>&gt;</span>S.enginner<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-3 col-md-3 col-sm-12 item"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/team-2.jpg"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"team"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"des"</span>&gt;</span>
      Layla 
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-muted"</span>&gt;</span>Front End Developer<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-3 col-md-3 col-sm-12 item"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">img</span> <span class="hljs-attr">src</span>=<span class="hljs-string">"images/team-3.jpg"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"img-fluid"</span> <span class="hljs-attr">alt</span>=<span class="hljs-string">"team"</span>&gt;</span>
     <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"des"</span>&gt;</span>
      J.Jirard
     <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">span</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"text-muted"</span>&gt;</span>Team Manger<span class="hljs-tag">&lt;/<span class="hljs-name">span</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
 <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>And let’s add some style:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.team</span>{
 <span class="hljs-attribute">margin</span>: <span class="hljs-number">4em</span> <span class="hljs-number">0</span>;
 <span class="hljs-attribute">position</span>: relative;  
}
<span class="hljs-selector-class">.team</span> <span class="hljs-selector-tag">h1</span>{
 <span class="hljs-attribute">color</span>:<span class="hljs-number">#F97300</span>;
 <span class="hljs-attribute">margin</span>: <span class="hljs-number">2em</span>; 
}
<span class="hljs-selector-class">.team</span> <span class="hljs-selector-class">.item</span>{
 <span class="hljs-attribute">position</span>: relative;
}
<span class="hljs-selector-class">.team</span> <span class="hljs-selector-class">.des</span>{
 <span class="hljs-attribute">background</span>: <span class="hljs-number">#F97300</span>;
 <span class="hljs-attribute">color</span>: <span class="hljs-number">#fff</span>;
 <span class="hljs-attribute">text-align</span>: center;
 <span class="hljs-attribute">border-bottom-left-radius</span>: <span class="hljs-number">93%</span>;
 <span class="hljs-attribute">transition</span>:.<span class="hljs-number">3s</span> ease-in-out;

}
</code></pre>
<p>Adding an overlay to the image on-hover using animation would be nice ?.</p>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*SxGguj9S8JMncs-D3uNcsA.gif" alt="Image" width="531" height="252" loading="lazy"></p>
<p>To make this effect , add the styles below to <code>**main.css**</code> file:</p>
<pre><code class="lang-css"><span class="hljs-selector-class">.team</span> <span class="hljs-selector-class">.item</span><span class="hljs-selector-pseudo">:hover</span> <span class="hljs-selector-class">.des</span>{
 <span class="hljs-attribute">height</span>: <span class="hljs-number">100%</span>;
 <span class="hljs-attribute">background</span>:<span class="hljs-number">#f973007d</span>;
 <span class="hljs-attribute">position</span>: absolute;
 <span class="hljs-attribute">width</span>: <span class="hljs-number">89%</span>;
 <span class="hljs-attribute">padding</span>: <span class="hljs-number">5em</span>;
 <span class="hljs-attribute">top</span>: <span class="hljs-number">0</span>;
 <span class="hljs-attribute">border-bottom-left-radius</span>: <span class="hljs-number">0</span>;
}
</code></pre>
<p>Super cool! ?</p>
<h3 id="heading-contact-form">Contact Form</h3>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*vaI3jh3TFwSKBn6BcsBedw.png" alt="Image" width="800" height="297" loading="lazy"></p>
<p>The Contact Form is the last section to add, then we are done ?.</p>
<p>The Contact Form section will contain a form through which visitors can send an email or give feedback. We will use some Bootstrap classes to make the design beautiful and responsive.</p>
<p>Like Bootstrap 3, Bootstrap 4 also uses the <code>.form-control</code> class for input fields, but there are some new features added — like switching from <code>.input-group-addon</code> (deprecated) to <code>**.input-group-prepend**</code> (to use icons as labels ).</p>
<p>See <a target="_blank" href="https://getbootstrap.com/docs/4.0/migration/#input-groups">Bootstrap 4 document</a> for more information. In our Contact form we will wrap each input between a <code>div</code> that has the class <code>.form-group</code>.</p>
<p>The <code>**index.html**</code> file now looks something like this:</p>
<pre><code class="lang-html"><span class="hljs-comment">&lt;!-- Contact form --&gt;</span>
<span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"contact-form"</span>&gt;</span>
 <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"container"</span>&gt;</span>
  <span class="hljs-tag">&lt;<span class="hljs-name">form</span>&gt;</span>
   <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"row"</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-4 col-md-4 col-sm-12"</span>&gt;</span>
      <span class="hljs-tag">&lt;<span class="hljs-name">h1</span>&gt;</span>Get in Touch<span class="hljs-tag">&lt;/<span class="hljs-name">h1</span>&gt;</span> 
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
    <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"col-lg-8 col-md-8 col-sm-12 right"</span>&gt;</span>
       <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"form-group"</span>&gt;</span>
         <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"text"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"form-control form-control-lg"</span> <span class="hljs-attr">placeholder</span>=<span class="hljs-string">"Your Name"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">""</span>&gt;</span>
       <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
       <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"form-group"</span>&gt;</span>
         <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"email"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"form-control form-control-lg"</span> <span class="hljs-attr">placeholder</span>=<span class="hljs-string">"YourEmail@email.com"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">"email"</span>&gt;</span>
       <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
       <span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"form-group"</span>&gt;</span>
         <span class="hljs-tag">&lt;<span class="hljs-name">textarea</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"form-control form-control-lg"</span>&gt;</span>

         <span class="hljs-tag">&lt;/<span class="hljs-name">textarea</span>&gt;</span>
       <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
       <span class="hljs-tag">&lt;<span class="hljs-name">input</span> <span class="hljs-attr">type</span>=<span class="hljs-string">"submit"</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"btn btn-secondary btn-block"</span> <span class="hljs-attr">value</span>=<span class="hljs-string">"Send"</span> <span class="hljs-attr">name</span>=<span class="hljs-string">""</span>&gt;</span>
    <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
   <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
  <span class="hljs-tag">&lt;/<span class="hljs-name">form</span>&gt;</span>
 <span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
<span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<p>Contact section’styles :</p>
<p><strong>main.css</strong></p>
<pre><code class="lang-css"><span class="hljs-selector-class">.contact-form</span>{
 <span class="hljs-attribute">margin</span>: <span class="hljs-number">6em</span> <span class="hljs-number">0</span>;
 <span class="hljs-attribute">position</span>: relative;  
}

<span class="hljs-selector-class">.contact-form</span> <span class="hljs-selector-tag">h1</span>{
 <span class="hljs-attribute">padding</span>:<span class="hljs-number">2em</span> <span class="hljs-number">1px</span>;
 <span class="hljs-attribute">color</span>: <span class="hljs-number">#F97300</span>; 
}
<span class="hljs-selector-class">.contact-form</span> <span class="hljs-selector-class">.right</span>{
 <span class="hljs-attribute">max-width</span>: <span class="hljs-number">600px</span>;
}
<span class="hljs-selector-class">.contact-form</span> <span class="hljs-selector-class">.right</span> <span class="hljs-selector-class">.btn-secondary</span>{
 <span class="hljs-attribute">background</span>:  <span class="hljs-number">#F97300</span>;
 <span class="hljs-attribute">color</span>: <span class="hljs-number">#fff</span>;
 <span class="hljs-attribute">border</span>:<span class="hljs-number">0</span>;
}
<span class="hljs-selector-class">.contact-form</span> <span class="hljs-selector-class">.right</span> <span class="hljs-selector-class">.form-control</span><span class="hljs-selector-pseudo">::placeholder</span>{
 <span class="hljs-attribute">color</span>: <span class="hljs-number">#888</span>;
 <span class="hljs-attribute">font-size</span>: <span class="hljs-number">16px</span>;
}
</code></pre>
<h4 id="heading-fonts">Fonts</h4>
<p>I think default fonts are ugly so we are going to use the Google Font API, and we’ll choose <strong>Raleway</strong> which is a nice font and appropriate to our template.</p>
<p>Add this link into your <code>**main.css**</code> file:</p>
<pre><code class="lang-css"><span class="hljs-keyword">@import</span> url(<span class="hljs-string">'https://fonts.googleapis.com/css?family=Raleway'</span>);
</code></pre>
<p>and set the global style to HTML and heading tags:</p>
<pre><code class="lang-css"><span class="hljs-selector-tag">html</span>,<span class="hljs-selector-tag">h1</span>,<span class="hljs-selector-tag">h2</span>,<span class="hljs-selector-tag">h3</span>,<span class="hljs-selector-tag">h4</span>,<span class="hljs-selector-tag">h5</span>,<span class="hljs-selector-tag">h6</span>,<span class="hljs-selector-tag">a</span>{
 <span class="hljs-attribute">font-family</span>: <span class="hljs-string">"Raleway"</span>;
}
</code></pre>
<h4 id="heading-scroll-effect"><strong>Scroll Effect</strong></h4>
<p><img src="https://cdn-media-1.freecodecamp.org/images/1*a9OoxPsn-hrbjYpbNV6DzA.gif" alt="Image" width="579" height="286" loading="lazy"></p>
<p>The last thing missing is scroll effect. Here, we’ll have to use some JQuery. Don’t worry️ if you are not familiar with it, just add this code into your <code>**main.js**</code> file:</p>
<pre><code class="lang-js">$(<span class="hljs-string">".navbar a"</span>).click(<span class="hljs-function"><span class="hljs-keyword">function</span>(<span class="hljs-params"></span>)</span>{
  $(<span class="hljs-string">"body,html"</span>).animate({
   <span class="hljs-attr">scrollTop</span>:$(<span class="hljs-string">"#"</span> + $(<span class="hljs-built_in">this</span>).data(<span class="hljs-string">'value'</span>)).offset().top
  },<span class="hljs-number">1000</span>)

 })
</code></pre>
<p>and add a <code>data-value</code> attribute to each navbar link:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
         <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link"</span> <span class="hljs-attr">data-value</span>=<span class="hljs-string">"about"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>About<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
       <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
       <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
         <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link "</span> <span class="hljs-attr">data-value</span>=<span class="hljs-string">"portfolio"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>Portfolio<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
       <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
       <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
         <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link "</span> <span class="hljs-attr">data-value</span>=<span class="hljs-string">"blog"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>Blog<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
       <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
       <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
         <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link "</span> <span class="hljs-attr">data-value</span>=<span class="hljs-string">"team"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>
         Team<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
       <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
       <span class="hljs-tag">&lt;<span class="hljs-name">li</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-item"</span>&gt;</span>
         <span class="hljs-tag">&lt;<span class="hljs-name">a</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"nav-link "</span> <span class="hljs-attr">data-value</span>=<span class="hljs-string">"contact"</span> <span class="hljs-attr">href</span>=<span class="hljs-string">"#"</span>&gt;</span>Contact<span class="hljs-tag">&lt;/<span class="hljs-name">a</span>&gt;</span>
       <span class="hljs-tag">&lt;/<span class="hljs-name">li</span>&gt;</span>
</code></pre>
<p>Set an <code>id</code> attribute to each section.</p>
<p><strong>Note</strong>: The <code>id</code> must be identical to the <code>data-value</code> attribute in the navbar link for the scroll to work:</p>
<pre><code class="lang-html"><span class="hljs-tag">&lt;<span class="hljs-name">div</span> <span class="hljs-attr">class</span>=<span class="hljs-string">"about"</span> <span class="hljs-attr">id</span>=<span class="hljs-string">"about"</span>&gt;</span><span class="hljs-tag">&lt;/<span class="hljs-name">div</span>&gt;</span>
</code></pre>
<h3 id="heading-wrap-up-and-conclusion">Wrap-up and Conclusion</h3>
<p>Bootstrap 4 is a great option for building your web application. It delivers high quality of UI elements and it’s easy to customize, integrate and use. It will also help you to include responsiveness in your website, therefore delivering a premium user experience to your users.</p>
<p>You will find the project’s files on <a target="_blank" href="https://github.com/hayanisaid/bootstrap4-website">GitHub</a>.</p>
<blockquote>
<p>If you need some Bootstrap themes and templates you can check out <a target="_blank" href="https://bootstrapbay.sjv.io/DV1q2">BootstrapBay</a>,they have some awesome products</p>
</blockquote>
<p>Check out my Bootstrap Class to learn Bootstrap 4:</p>
<p><a target="_blank" href="https://skl.sh/2LaD1ym"><strong>Bootstrap 4 crash course: basic to advance | Said Hayani | Skillshare</strong></a><br><a target="_blank" href="https://skl.sh/2LaD1ym">_In this class the you are going to learn bootstrap version 4, the CSS framework to build flexible templates and…_skl.sh</a></p>
 ]]>
                </content:encoded>
            </item>
        
    </channel>
</rss>
