Basics Flashcards

1
Q

vs Submit

A

Submit

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

It is considered best practice to set a for attribute on the label element, with a value…?

A

…that matches the value of the id attribute of the input element. This allows assistive technologies to create a linked relationship between the label and the child input element

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

if there are conflicting declarations within class and id in css which one would be applied?

A

However, an id is not reusable and should only be applied to one element. An id also has a higher specificity (importance) than a class so if both are applied to the same element and have conflicting styles, the styles of the id will be applied.

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

when you set padding padding: 10px 20px 10px 20px; (or whatever has 4 parameters) in what order does it work?

A

clockwise notation. These four values work like a clock: top, right, bottom, left, and will produce the exact same result as using the side-specific padding instructions.

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

how to apply CSS code to all elements with specific value of a given attribute?

A

[type=’radio’] {
margin: 20px 0px 20px 0px;
}
don’t forget the quotes!

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

Relative units, such as em or rem, are relative to another length value. Which one?

A

For example, em is based on the size of an element’s font. If you use it to set the font-size property itself, it’s relative to the parent’s font-size.

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

Overriding CSS. how many levels is there and what are they?

A
  1. html tag style
  2. class style
  3. last declared class style
  4. ID style
  5. inline style in the dag itself
  6. mark !important in any css block
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Variables

background: var(–penguin-beak, orange);

A

reference to the variable and a fallback value of orange

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

How to set a CSS var so it is available throughout the entire document?

A

When you create a variable, it becomes available for you to use inside the element in which you create it. It also becomes available within any elements nested within it. This effect is known as cascading. Because of cascading, CSS variables are often defined in the :root element.

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

Can the css var be redefined? How to redefine it for a smaller screen size?

A

@media (max-width: 350px) {
:root {

  /* add code below */
  --penguin-size:200px;
  --penguin-skin:black;
  /* add code above */

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

recommended alternative for <i>?</i>

A

<em></em>

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

recommended alternative for <b>?</b>

A

<strong></strong>

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

recommended alternative for ?

A

<del></del>

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

keyword for shadows?

A

The box-shadow property takes values for offset-x (how far to push the shadow horizontally from the element), offset-y (how far to push the shadow vertically from the element), blur-radius, spread-radius and a color value, in that order. The blur-radius and spread-radius values are optional.
box-shadow: 0 10px 20px rgba(0,0,0,0.19), 0 6px 6px rgba(0,0,0,0.23);

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

what pseudo-classes do you know?

A

hover

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

what’s the range of hue() in css?

A

hue uses a color wheel concept instead of the spectrum, where the angle of the color on the circle is given as a value between 0 and 360.

17
Q

call the arguments hsl(240, 100%, 50%)

A

hue saturation lightness

18
Q

when to use HSL()?

A

This is useful when you have a base hue you like, but need different variations of it.

19
Q

how to attach something to an element using css?

A
.heart:after {
background-color: blue;
content: "";
border-radius: 25%;
position: absolute;
width: 50px;
height: 50px;
top: 0px;
left: 25px;
}
20
Q

how to set up animation?

A
#anim {
animation-name: colorful;
animation-duration: 3s;
}
@keyframes colorful {
0% {
background-color: blue;
}
100% {
background-color: yellow;
}
}
21
Q

How to make the animation last after it finishes?

A

animation-fill-mode: forwards;

22
Q

How to make animation play forever?

A

animation-iteration-count: infinite;

23
Q

animation-timing-function options

A

ease ;ease-out; ease-in; linear; cubic-bezier(0, 0, 0.58, 1); etc

24
Q

what about setting alt attribute to IMG in HTML5?

A

Per HTML5 specification, this is now considered mandatory. If IMG is a decoration, alt attribute should be present but can be empty

25
Q

What special there is about H1 tag?

A

One final point, each page should always have one (and only one) h1 element, which is the main subject of your content. This and the other headings are used in part by search engines to understand the topic of the page.

26
Q

How divs van be replaced?

A

HTML5 introduced a number of new elements that give developers more options while also incorporating accessibility features. These tags include main, header, footer, nav, article, and section, among others.

27
Q

“Click here”-only links should be…

A

replaced or extended with more meaningful text

28
Q

accesskey is meant for..

A

interactive elements such as forms, links, buttons

29
Q

how to stretch an image up to its original width to fit to the resized block?

A
img {
max-width: 100%;
display: block;
height: auto;
}
30
Q

how to optimize images for retina displays?

A

The simplest way to make your images appear “retina” (and optimize them for retina displays) is to define their width and height values as only half of what the original file is.

31
Q

grid-template-columns - settings for each column

A

grid-template-columns:10px 5px 10px auto 50px 10% 2fr 1fr