Components - plug in and play!
In this unit, you will be introduced to Bootstrap components.
These are sweet little blocks of html that Bootstrap provides for us.
We can just plug them into our webpages and edit the content to suit our purposes.
Here is some HTML markup from Bootstrap's website that I copied and pasted into my webpage. The result is on the right, a dropdown menu.
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button">
Dropdown button
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Action</a>
<a class="dropdown-item" href="#">Another action</a>
<a class="dropdown-item" href="#">Something else here</a>
</div>
</div>
Now all I have to do is edit it for my webpage idea.
<div class="dropdown">
<button class="btn btn-secondary dropdown-toggle" type="button">
Things to do
</button>
<div class="dropdown-menu" aria-labelledby="dropdownMenuButton">
<a class="dropdown-item" href="#">Food and Drink</a>
<a class="dropdown-item" href="#">Sport events</a>
<a class="dropdown-item" href="#">Fashion shows</a>
</div>
</div>
Note that the btn-secondary class applied to the button element is just one option. According to Bootstrap's component documentation there are other options, too
The following video introduces how to plug components into your webpage if you need more help.
Follow these instructions and let's put some components into our responsive web page!
Upload your Tokyo folder to your shared online folder.