HTML & CSS Exercise Questions Flashcards

1
Q

Where do you put non-visable content about the HTML Document?

A

In the head element

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

Where do you put visible content about the HTML document?

A

In the body element

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

Where do the <head> and <body> tags go in a valid HTML document?

A

The head is within the html tag and you can put a title tag inside. The body is before the closing tag of HTML

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

What is the purpose of a <!DOCTYPE> declaration?

A

o To declare which type of html you are using

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

Give five examples of HTML element types.

A

head, title, P, img, body

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

What is the purpose of HTML attributes?

A

To provide additional information about the context of the element and appear near the opening tag of the element

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

Give an example of an HTML entity (escape character).

A

&copy = Copyright symbol

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

How do block-level elements affect the document flow?

A

Block level elements would push down to a new line every time a new block element is introduced

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

How do inline elements affect the document flow?

A

If it is an inline element it won’t push your text over to the next line like a block element would

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

What are the default width and height of a block-level element?

A

The entire horizontal space of its parent element (container), and the vertical space equal to the height of its contents

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

What are the default width and height of an inline element?

A

The height of an inline element is the height of the content. Only as much width as necessary

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

What is the difference between an ordered list and an unordered list in HTML?

A

Ordered list will have an <ol></ol> tag and unordered list will be <ul></ul>

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

Is an HTML list a block element or an inline element?

A

Block element because it moves to a new line on the list

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

What HTML tag is used to link to another website?

A

Anchor tag

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

What is an absolute URL?

A

Contains the entire address such as the domain name and includes the location within your website in your folder system names within the URL

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

What is a relative URL?

A

Are used when linking pages within own website and do not use the full web address ; only the location following the domain

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

How do you indicate the relative link to a parent directory?

A

../index.html

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

How do you indicate the relative link to a child directory?

A

Childfoldername/nameofchilddocument.html

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

How do you indicate the relative link to a grand parent directory?

A

../../index.html to go backwards

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

How do you indicate the relative link to the same directory?

A

Just the name of the file

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

What is the purpose of an HTML form element?

A

Create a form that can be submitted

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

Give three examples of type attribute values for HTML <input></input> elements.

A

o Radio
o Checkbox
o Submit

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

Is an HTML <input></input> element a block element or an inline element?

A

Inline

24
Q

What are the six primary HTML elements for creating tables?

A

o <table>
o <tr> indicating new row
o <td> each cell is represented with a td
o <th> element that is used to represent the heading for a column or row
o <thead> the heading for the table should sit inside here
o <tbody> the body should sit inside here

25
Q

What purpose do the thead and tbody elements serve?

A

To let dictate to the system where the header and body should be

26
Q

Give two examples of data that would lend itself well to being displayed in a table.

A

Data involving how to organize student grades and financing??

27
Q

What are the names of the individual pieces of a CSS rule?

A

o CSS Selector
o Curly braces for declaration block
o Properties
o Values

28
Q

In CSS, how do you select elements by their class attribute?

A

With a period

29
Q

In CSS, how do you select elements by their tag name?

A

Just the element tag

30
Q

In CSS, how do you select an element by its id attribute?

A

Use the #

31
Q

Name three different types of values you can use to specify colors in CSS.

A

o RGB values – expressed in how much red, green, and blue it is made up of
o Hex Codes- six digit codes that represent the amount of red, green, and blue
o Color Names

32
Q

What CSS properties make up the box model?

A

Every box has three properties of border, margin, and padding

33
Q

Which CSS property pushes boxes away from each other?

A

Margins- sit outside of the edge of a border and you can set the width to create a gap between the borders of two adjacent boxes

34
Q

Which CSS property add space between a box’s content and its border?

A

Padding is the space between the border of a box and any content contained within it. Adding padding can increase the readability of its contents

35
Q

What is a pseudo-class?

A

A keyword added to a selector that specifies a special state of the selected element(s) such as :hover :active :focus

36
Q

What are CSS pseudo-classes useful for?

A

Useful for whenever the user is inspecting an element and need a visual appearance to change

37
Q

Table.striped tbody > tr:nth-child(odd)

A

HOW TO CODE READ:
Tr elements that are nth child odd that are direct child of a tbody that are within a table element of class of striped

38
Q

What does > do in CSS?

A

Identifies that you are looking only for a direct child

39
Q

Name two types of units that can be used to adjust font-sizes in CSS

A

Pixels and rem. Avoid using percentages here.

40
Q

What CSS property controls the font used for the text inside an element?

A

Font-family

41
Q

What is the default flex-direction of a flex container?

A

Row. Can change axis here by using column and not row

42
Q

What is the default flex-wrap of a flex container?

A

No wrap

43
Q

Why do two div elements “vertically stack” on one another by default?

A

Because they are block elements

44
Q

What is the default flex-direction of an element with display: flex?

A

Row

45
Q

What are the three primary components of a page layout? (Which helper classes do you need?)

A
  1. Container
  2. Row
  3. Column
46
Q

What is the minimum number of columns that you should put in a row?

A

One

47
Q

What is the purpose of a container?

A

Containers allow you to manipulate whatever you want to the div and add margins to divs when needed

48
Q

What does the transform property do?

A

Allows you to visually manipulate an element; change the shape, position, and orientation of page elements

49
Q

Give four examples of CSS transform functions

A

Rotate, scale, skew, or translate

50
Q

The transition property is shorthand for which four CSS properties?

A

Transition-property, transition-duration, transition-timing-function, and transition delay

51
Q

Give two examples of media features that you can query in an @media ruel

A

Min-width & height

52
Q

Which HTML meta tag is used in mobile-responsive web pages?

A

viewport

53
Q

What is a breakpoint in responsive web design?

A

The point at which a website’s content and design will adapt in a certain way in order to provide the best possible user experience. Set a specific pixel width we want our css to kick in

54
Q

What is the advantage of using a percentage (e.g. 50%) width instead of a fixed (e.g. px) width for a “column” class in a responsive layout?

A

If you set the width as a percentage, it will always keep its pixels at 50% at whatever its container size is.
Using percentages will allow it to move based on screen sizes

55
Q

If you introduce CSS rules for a smaller min-width after the styles for a larger min-width in your style sheet, the CSS rules for the smaller min-width will “win”. Why is that?

A

In css the later rulesets have priority over the one before it
All @media have the same weight in the cascade so whichever comes last will take priority based on “source order”