CSS Flashcards

1
Q

Bootstrap: Why is normalize.css used?

A

To improve cross-browser rendering.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Bootstrap: Why are containers used?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Bootstrap: How do you create a grid?

A
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
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Bootstrap: What happens when you create a fluid container?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Bootstrap: How do you offset columns in a grid?

A

div class=”.col-lg-6 col-lg-offset-2” /div

=> offsets it by 2 columns

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Bootstrap: How can you nest a grid?

A

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.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Bootstrap: where does lg stand for in .col-lg-6?

A

It stands for the viewport size. Large Desktops. The grid system has various styles for different viewport sizes.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Bootstrap: What are the viewport sizes in a grid? How can you support different viewport sizes in your app?

A

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

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Bootstrap: how do you create a button?

A

Use a or button tag and set class:
btn btn-default
For size add:
btn-lg or btn-xs or btn-sm

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Bootstrap: How can you make a button span the whole width of its parent?

A

Use the btn-block class

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Bootstrap: How can you add a glyphicon

A

span class=”glyphicon glyphicon-search”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Bootstrap: How can you add a glyphicon in a button?

A

Define a span with the right class inside the button.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

Bootstrap: How can you manipulate the size and color of a glyphicon?

A

By using css (style attribute or css file) e.g. font-size: 5-em

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Bootstrap: How can you create a form?

A

Create a form html type with a role=form attribute. Inside the firm you create (class=) form-group divs

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

Bootstrap: How do you link a label to an input in a form

A

label for=”form-elem-2”

input id=”form-elem-2”

How well did you know this?
1
Not at all
2
3
4
5
Perfectly