CSS Flashcards

1
Q

What is CSS? what are the different ways of styling an html file?

A

Cascading Style Sheets is a style sheet language used for describing the presentation of a document written in a markup language like HTML
Styling Html file:

  • Inline style (inside an HTML element)
  • External and internal style sheets (in the head section)
  • Browser default

inline style has the highest priority, and will override external and internal styles and browser defaults.

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

What are the different CSS selectors? Write the syntax for each.

A

unique {

Three simple selectors

Element Selector
Id Selector
Class Selector

Priority of Selectors

Id > Class > Element

Element Example:

h1
{
Color: red;
}

id example:

Color: red;
}

class example:

.group {
Color: red;
}

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

What is a psuedo-class? What is the syntax for selecting that?

A

A keyword added to a selector that specifies a special state of the selected element(s)

:hover - mouseover
:visited - visited link
:focus - element presently in focus
:enabled - element that can be clicked or selected
:disabled - element that cannot be clicked or selected

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

Explain the concept of specificity and how it relates to styling conflicts

A

Specificity is the means by which browsers decide which CSS property values are the most relevant to an element and, therefore, will be applied.

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

Explain the CSS box model

A

The CSS box model describes the rectangular boxes that are generated for elements

Each box has a content area (e.g. text, an image, etc.) and an optional surrounding padding, border, and margin areas

The CSS box model is responsible for calculating:
a)How much space a block element takes up.
b)Whether or not borders and/or margins overlap, or collapse.
c)A box’s dimensions.

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

What features did CSS3 introduce?

A

rounded corners,
box shadows,
RGBA, HSL and HSLA colors,
box sizing,
Opacity,
CSS3 Gradients,
transitions,
transformations,
animations,
multi-column layout,
flex box,
CSS grids,
embedded fonts,
Responsive web design

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

What is Bootstrap? What are some bootstrap classes you can use?

A

Bootstrap is a free front-end framework for faster and easier web development.

Some classes you can use are:

.btn-block Creates a block level button that spans the entire width of the parent element
.btn-danger Red button. Indicates danger or a negative action
.btn-default Default button. White background and grey border
.btn-group Groups buttons together on a single line

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

How many columns make up the Bootstrap grid system?

A

twelve

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

What is a CDN? what are the benefits?

A

Content Delivery Networks (CDN) accounts for large share of delivering content across websites users and networks across the globe.

  • Faster content load / response time in delivering content to end users.
  • Availability and scalability, because CDNs can be integrated with cloud models
  • Redundancy in content, thus minimizing errors and there is no need for additional expensive hardware
  • Enhanced user experience with CDNs as they can handle peak time loads
  • Data integrity and privacy concerns are addressed
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When would you choose to use a CDN vs downloading and using the Bootstrap source code in your project?

A

You would choose to use a CDN when you want faster downloads without impacting the server and bandwidth.

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