CSS Flashcards
Bootstrap: Why is normalize.css used?
To improve cross-browser rendering.
Bootstrap: Why are containers used?
To easily center a page’s content. Containers set width at various media query breakpoints to match the grid system. Warning: containers are NOT nestable by default.
Bootstrap: How do you create a grid?
You get a grid of 12 columns: div class="container> div class="row" div class=".col-lg-6" /div div class=".col-lg-6" /div /div /div
Bootstrap: What happens when you create a fluid container?
A container has a fixed width. When you create container-fluid, the width is the whole screen, and it changes when you resize your page.
Bootstrap: How do you offset columns in a grid?
div class=”.col-lg-6 col-lg-offset-2” /div
=> offsets it by 2 columns
Bootstrap: How can you nest a grid?
Inside a column you can add another row div by adding it before the column div ends.
In the nested grid the columns should also add up to 12.
So if your parent column is 4 column length, the nested row will have columns of size 4/12.
Bootstrap: where does lg stand for in .col-lg-6?
It stands for the viewport size. Large Desktops. The grid system has various styles for different viewport sizes.
Bootstrap: What are the viewport sizes in a grid? How can you support different viewport sizes in your app?
lg > md > sm > xs
div class=”.col-lg-6 .col-md 2” => However if you define a small viewport, all the larger ones will have the same distribution, so it is not necessary to write .col-lg-6 .col-md 6
Bootstrap: how do you create a button?
Use a or button tag and set class:
btn btn-default
For size add:
btn-lg or btn-xs or btn-sm
Bootstrap: How can you make a button span the whole width of its parent?
Use the btn-block class
Bootstrap: How can you add a glyphicon
span class=”glyphicon glyphicon-search”
Bootstrap: How can you add a glyphicon in a button?
Define a span with the right class inside the button.
Bootstrap: How can you manipulate the size and color of a glyphicon?
By using css (style attribute or css file) e.g. font-size: 5-em
Bootstrap: How can you create a form?
Create a form html type with a role=form attribute. Inside the firm you create (class=) form-group divs
Bootstrap: How do you link a label to an input in a form
label for=”form-elem-2”
input id=”form-elem-2”