HTML/CSS Quiz Flashcards

(71 cards)

1
Q

What is an HTML element composed of?

A

An HTML element has an opening tag, content, and a closing tag. Example: <p>Hello World!</p>

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

What is semantic HTML?

A

Semantic HTML adds meaning to the page using elements like main, section, and article which can hold content such as blogs and comments. Article is placed inside section.

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

What is the aside element used for?

A

The aside element is used to mark additional info that can enhance another element, such as bibliographies, endnotes, comments, pull quotes, and sidebars.

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

What does a CSS rule consist of?

A

A CSS rule consists of a selector (which element to target), a declaration block containing property-value pairs. Example: h1 { color: blue; }

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

What is an attribute selector in CSS?

A

An attribute selector targets elements with an href attribute value of a specific class. Example: [href] { color: magenta; } or a[href*=’florence’] { color: lightgreen; }

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

What are pseudo-classes in CSS?

A

Pseudo-classes are selectors like :focus, :visited, :disabled, and :active that select only specific elements with a class of special or based on their state.

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

What is a descendant combinator?

A

A descendant combinator (.main-list li) selects the element <li> with the .main-list class using a space between selectors.

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

What are web safe fonts?

A

Web safe fonts are fonts that are widely available across different systems and browsers, ensuring consistent display.

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

What CSS properties control text alignment and justify?

A

text-align with values: left, center, right, justify

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

What is the opacity property in CSS?

A

Opacity determines how transparent an element is, with values from 1 (fully visible) to 0 (transparent).

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

What is the CSS Box Model?

A

The Box Model consists of margin (outermost), border, padding, and content (innermost). Height and width define the content area.

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

What does border: 3px solid coral; do?

A

It creates a border that is 3 pixels wide, with a solid style, in coral color (width, style, color format).

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

What is the difference between width and margin: 0 auto?

A

width (e.g., 400px) sets the element width. margin: 0 auto centers the divs in their containing elements.

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

What are min-width and max-width?

A

min-width and max-width set limits on how wide an element can become, helping with responsive design.

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

What does the overflow property control?

A

Overflow controls what happens to content that spills outside its box, with values: hidden, scroll, or visible.

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

What does the visibility property do?

A

Visibility hides elements (hidden, visible, collapse). With ‘none’, the element is completely removed and space will be invisible.

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

What is box-sizing: border-box?

A

In border-box model, the height and width of the box will remain fixed. Border and padding will be included inside the box (content, padding, border). Dimensions of elements remain the same regardless of border and padding.

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

What are block-level elements?

A

Block-level elements take the full width of their parent elements and prevent other elements from appearing in the same horizontal space. Examples: <h1>, <p>, <div>, <footer>

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

What is the position: relative property?

A

Position relative allows positioning with top/bottom/left/right values. All other elements on the page will ignore the element and act like it’s not present.

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

What is position: absolute?

A

Position absolute positions all other elements on the page as if the element doesn’t exist. The element will be positioned relative to its closest ancestor with position property set to anything other than static. Element will scroll.

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

What is position: fixed?

A

Position fixed fixes an element to a specific position on the page (regardless of scrolling) and accompanies it with the offset properties of top, bottom, left, right.

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

What is position: sticky?

A

Sticky keeps the element in the document flow as the user scrolls, but sticks to a specified position as the page is scrolled further.

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

What is z-index?

A

z-index controls the layering of elements, with higher values appearing on top. It works with display: inline, block, inline-block.

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

What is the default display of <em>, <strong>, and <a> elements?</a></strong></em>

A

The default display is inline - they only take the amount of space necessary to display their content and can appear next to each other. We can specify their dimensions using width and height with inline-block.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What are block elements?
Block elements fill the entire width of the page by default. Width can be set. Examples:

,

,

,

26
What is inline-block?
inline-block combines features of both inline and block elements. Elements can appear next to each other and we can specify their dimensions using width and height. Images use inline-block.
27
What is the float property?
Float property is used to move elements as far right or left as possible in the container. Must have width specified.
28
What are color formats in CSS?
Colors can be named (coral), RGB (3 values 0-255 for red-green-blue), HSL (hue-saturation-lightness), or Hex (hexadecimal 3-6 characters).
29
What is the alpha value in colors?
Alpha represents the opacity/transparency in HSLA and RGBA formats. Values: 1 = opaque, 0 = transparent. Example: hsla(34, 100%, 50%, 0.1)
30
What does color: transparent do?
It makes the foreground color transparent, appearing as if no color is applied.
31
What is foreground color in CSS?
Foreground color is the color that an element appears in (using the color property).
32
What color systems are available in CSS?
Named colors, RGB (3 values 0-255 for red-green-blue), HSL (hue 0-360, saturation %, lightness %), Hex (3-6 characters), with opacity/alpha options for HSLA and RGBA.
33
What typography properties are available in CSS?
font-family, font-weight (400 normal, 700 bold), font-style (italic), text-transform (uppercase), letter-spacing (2px), word-spacing (0.3rem), line-height (1.4), text-align (right)
34
How do you use custom fonts with @font-face?
Use @font-face { font-family: 'MyFont'; src: url('fonts/Roboto.woff2'); format('woff2'); } at the top of your stylesheet, then reference with font-family: 'MyFont', sans-serif;
35
What is serif vs sans-serif?
Serif fonts have extra details on the ends of the main strokes of letters. Sans-serif fonts lack those extra strokes.
36
Where should you reference font files?
Move the woff2 files to a folder inside my website's working directory using @font-face at the top of the stylesheet.
37
What are link states in CSS?
Link states include normal (:link), hover (:hover), active/clicked (:active), and visited (:visited). Different cursor styles can be applied: a { cursor: pointer; }
38
What is Flexbox?
Flexbox is a CSS layout system where all divs with class container have display: flex, creating a flex container with flex items inside arranged along the main axis or cross axis.
39
What does justify-content do in Flexbox?
justify-content controls alignment along the main axis with values: flex-start, flex-end, center, space-around (equal space before and after each item), space-between
40
What does align-items do in Flexbox?
align-items controls alignment along the cross axis with values: flex-start (min-height), flex-end (max-height), center (min-width), baseline (max-width), stretch
41
What is flex-grow?
flex-grow allows us to specify if items should grow to fill a container and which items should grow proportionally more or less than others. Margins are unaffected.
42
What is flex-shrink?
flex-shrink specifies which elements will shrink and in what proportions when the container becomes too small.
43
What is flex-basis?
flex-basis specifies the width of an item before it stretches or shrinks (in flex). Example: flex-basis: 150px
44
What is the flex shorthand property?
flex is shorthand for specifying flex-grow, flex-shrink, and flex-basis. Example: flex: 2 1 150px means grow twice as much, shrink, with 150px basis (undefined affects the element).
45
What does flex-wrap do?
flex-wrap moves flex items to the next line with values: wrap, wrap-reverse, nowrap
46
What is align-content?
align-content aligns elements within a single row when a flex container has multiple rows of content. Use it to space rows from top to bottom with values: flex-start, flex-end, center, space-between, space-around, stretch
47
What is flex-direction?
flex-direction specifies how flex items are ordered. The main and cross axis are interchangeable using this property. Values: row, row-reverse, column, column-reverse. flex-direction: column makes flex items ordered vertically, not horizontally.
48
What is flex-flow?
flex-flow declares both flex-wrap and flex-direction properties in one line. Example: .container { display: flex; flex-flow: column wrap; } equals display: flex, flex-flow: column wrap
49
What is a grid in responsive design?
A grid system uses gutters (negative space between columns), columns, and margins to organize content and create layouts for different screen sizes.
50
What is the typical grid column setup for different devices?
Desktop: 12 columns, Tablet: 6 columns, Mobile: 3 columns
51
What is white space (negative space)?
White space or negative space can be manipulated with CSS properties like line-height and margin to improve readability and visual hierarchy.
52
What is active whitespace?
Active whitespace refers to enhancing the overall page structure through space to emphasize content or guide users from one point to the next.
53
What is the difference between px and relative measurements?
px is a hard-coded measurement. Relative measurements like em and percentages are better for responsive design.
54
What is the em unit?
em is the font-size of the current element or the default base font-size set by the browser if none is given. Em sizes fonts relative to the font-size of a parent element. 1em = 16px
55
What is the rem unit?
rem (root em) sizes fonts relative to the root element instead of checking parent elements. The root element is the tag. Best for sizing elements consistently across an entire website.
56
What are percentages used for in CSS?
Percentages are used to size non-text HTML elements relative to their parent elements (width-height-padding-border-margins). For height & width: margin-top: 20%
57
What are min-width and max-width used for?
You can limit how wide an element becomes using min-width and max-width properties.
58
What are min-height and max-height used for?
min-height and max-height properties set minimum and maximum height limits for elements.
59
How do you scale images and videos?
For a container with width: 50%, height: 200px, overflow: hidden and an image inside with max-width: 100%, height: auto, display: block - the image height will automatically scale proportionally with the width. This prevents images from attempting to align with other content on the page and scales the width of an image to the width of a container.
60
How do you create scaling background images?
Use body { background-image: url('#'); background-repeat: no-repeat; background-position: center; background-size: cover; }
61
What are media queries?
Media queries adapt a website's content to different screen sizes using syntax like:
62
What is the syntax for a media query?
@media only screen and (max-width: 480px) { page-title { font-size: 12px; } } - This targets devices with a width of 480px or smaller using media features.
63
What does min-width in a media query target?
min-width targets screens ABOVE a certain size. Example: @media only screen and (min-width: 320px) and (max-width: 480px) targets the range 320px-480px.
64
What are media query ranges?
@media only screen and (min-width: 320px) and (max-width: 480px) { } creates a ruleset for screens smaller than 480px. Use range for 320px-480px.
65
What is dots per inch (DPI) / screen resolution?
DPI measures screen resolution. Media queries can target specific resolutions: @media only screen and (min-resolution: 300 dpi) { }
66
What is a comma-separated list in media queries?
If only one of multiple media features in a media query must be met, media features can be separated in a comma-separated list. Example: @media only screen and (min-width: 480px) (orientation: landscape) { } (requires only 1 of the media features to be true for the CSS to apply)
67
What are breakpoints?
Breakpoints are the points at which media queries are set. Rather than set breakpoints based on specific devices, the best practice is to resize your browser to view where the website naturally breaks based on its content. The dimensions at which the layout breaks or looks odd become your media query breakpoints.
68
What is clickability in web design?
Clickability refers to affordances - objects that offer the ability for users to interact with them in various ways.
69
What are signifiers in UX design?
Signifiers are aspects of an object that a designer uses to indicate potential and intended affordances of an object.
70
What are UX patterns?
UX patterns establish reusable solutions to common problems in user experience design.
71
What is a wireframe?
A wireframe is a basic visual layout showing the structure and hierarchy of a webpage, focusing on visual hierarchy, cohesion, and continuity.