mdbootstrap4-pro
Version:
MDBootstrap 4 PRO
115 lines (77 loc) • 12.4 kB
HTML
<!--Section: Tutorial content-->
<section>
<!--Section: Tutorial content-->
<section>
<p>In the first row, we are using <strong>2 columns</strong>. One of them is a perfect place for an outstanding image
that will be an eye-catcher for our visitors. The second column will be useful for heading, short description
and call to action button.
</p>
<p class="h5 mt-4">Step 1</p>
<p>In the first column of the first row place an image. You can use any image you want, by providing a correct URL.
</p>
<pre class="code-toolbar"><code class="language-markup">
<div class="col-md-7">
<!--Featured image -->
<img src="https://mdbootstrap.com/img/Photos/Slides/img%20(70).jpg" class="img-fluid">
</div>
</code></pre>
<p>Pay attention to the special class <strong>"img-fluid"</strong>. It makes our image responsive, which means that
it will always adjust to the screen size and it parents width. Thanks to that our visitors can enjoy watching
it both on mobile and desktop.</p>
<p class="h5 mt-4">Step 2</p>
<p>We can easily enhance our image by adding a subtle shadow, hover effect and waves effect. To achieve that we need
to place the image within a special wrapper.</p>
<p><strong>Replace the code of our image with the code below.</strong> </p>
<pre class="code-toolbar"><code class="language-markup">
<!--Featured image -->
<div class="view overlay hm-white-light z-depth-1-half">
<img src="https://mdbootstrap.com/img/Photos/Slides/img%20(70).jpg" class="img-fluid " alt="">
<div class="mask"></div>
</div>
</code></pre>
<p>Save the file and refresh your browser. Now you can enjoy all the effects.</p>
<p class="h5 mt-4">Step 3</p>
<p>As we said before, in the second column we'll place heading, short description and call to action. That will help
our visitor to quickly understand what our website is about (heading and description) and what action we expect
from them (call to action button).</p>
<pre class="code-toolbar"><code class="language-markup">
<h2>Some awesome heading</h2> <hr> <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Blanditiis pariatur quod ipsum atque quam dolorem voluptate officia sunt placeat consectetur alias fugit cum praesentium ratione sint mollitia, perferendis natus quaerat!</p> <a href="https://mdbootstrap.com/" class="btn btn-primary">Get it now!</a>
</code></pre>
<p>If you want to play with it, you can change a call to action button. MDB provides you a huge variety of buttons.</p>
<p>Go to <a href="https://mdbootstrap.com/components/buttons/">BUTTONS DOCUMENTATION</a> section in our documentation
and use the element you like the most. </p>
<p>Save the file and open it in the browser.</p>
<p>Thanks to MDB our project is growing fast, so let's keep going!</p>
<p class="h5 mt-4">Step 4</p>
<p>In the second row, we are going to add some detailed information about our website. Our <strong>cards</strong> will
do the work.</p>
<p>Cards are great to present content to the users. They are clear, easy to use and elegant. Facebook uses cards, Google
uses cards, LinkedIn uses cards. You also should do that, especially that MDB provides you really outstanding
cards.</p>
<p>Go to the <a href="https://mdbootstrap.com/components/cards/#waves-effect">CARDS DOCUMENTATION</a> and grab the Card
with Waves Effect. Then paste it to every column of the second row.</p>
<p><strong>After all your second row should look like this:</strong></p>
<pre class="code-toolbar"><code class="language-markup">
<!--Grid row--> <div class="row"> <!--Grid column--> <div class="col-lg-4 col-md-12"> <!--Card--> <div class="card"> <!--Card image--> <div class="view overlay hm-white-slight"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(72).jpg" class="img-fluid" alt=""> <a href="#"> <div class="mask"></div> </a> </div> <!--Card content--> <div class="card-body"> <!--Title--> <h4 class="card-title">Card title</h4> <!--Text--> <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> <a href="#" class="btn btn-primary">Button</a> </div> </div> <!--/.Card--> </div> <!--Grid column--> <!--Grid column--> <div class="col-lg-4 col-md-6"> <!--Card--> <div class="card"> <!--Card image--> <div class="view overlay hm-white-slight"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(74).jpg" class="img-fluid" alt=""> <a href="#"> <div class="mask"></div> </a> </div> <!--Card content--> <div class="card-body"> <!--Title--> <h4 class="card-title">Card title</h4> <!--Text--> <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> <a href="#" class="btn btn-primary">Button</a> </div> </div> <!--/.Card--> </div> <!--Grid column--> <!--Grid column--> <div class="col-lg-4 col-md-6"> <!--Card--> <div class="card"> <!--Card image--> <div class="view overlay hm-white-slight"> <img src="https://mdbootstrap.com/img/Photos/Horizontal/Nature/4-col/img%20(75).jpg" class="img-fluid" alt=""> <a href="#"> <div class="mask"></div> </a> </div> <!--Card content--> <div class="card-body"> <!--Title--> <h4 class="card-title">Card title</h4> <!--Text--> <p class="card-text">Some quick example text to build on the card title and make up the bulk of the card's content.</p> <a href="#" class="btn btn-primary">Button</a> </div> </div> <!--/.Card--> </div> <!--Grid column--> </div> <!--Grid row-->
</code></pre>
<p>Save the file and open it in the browser. Our layout still needs a few improvements, but we'll take care of it later.</p>
<p class="h5 mt-4">Step 5</p>
<p>Now it's time for the footer.</p>
<p>Go to the <a href="https://mdbootstrap.com/components/footers/#basic">FOOTER DOCUMENTATION</a> and grab the code
of Basic Footer. Then paste it to our project:</p>
<pre class="code-toolbar"><code class="language-markup">
<!--Footer--> <footer class="page-footer blue center-on-small-only"> <!--Footer Links--> <div class="container-fluid"> <div class="row"> <!--First column--> <div class="col-md-6"> <h5 class="title">Footer Content</h5> <p>Here you can use rows and columns here to organize your footer content.</p> </div> <!--/.First column--> <!--Second column--> <div class="col-md-6"> <h5 class="title">Links</h5> <ul> <li><a href="#!">Link 1</a></li> <li><a href="#!">Link 2</a></li> <li><a href="#!">Link 3</a></li> <li><a href="#!">Link 4</a></li> </ul> </div> <!--/.Second column--> </div> </div> <!--/.Footer Links--> <!--Copyright--> <div class="footer-copyright"> <div class="container-fluid"> © 2015 Copyright: <a href="https://www.MDBootstrap.com"> MDBootstrap.com </a> </div> </div> <!--/.Copyright--> </footer> <!--/.Footer-->
</code></pre>
<p>You can see that our footer already contains a color class "blue", which makes it blue. You can easily change it
by using one of over <a href="https://mdbootstrap.com/css/colors/">300 defined color classes</a> provided by
MDB</p>
<p>In the next lesson, you will learn how to manipulate MDB colors.</p>
<p>You can also notice class <code>.center-on-small-only</code> which center footers elements on small screens.</p>
<p>Alright, the main layout of our website is done, but it's still a lot of details to improve.</p>
<p>I.e. navbars and footesr colors are slightly different, and their links are stretched full-width, which doesn't look
good. Also content in our rows of <code><main></code> section are too close to each other. And there are
few more things which should be fixed.</p>
<p>That website definitely requires more work to make it looks professional. We'll take care of it in the next lesson.
</p>
</section>
<!--Section: Tutorial content-->