html basics Flashcards

1
Q

what are and when should elements be used?

A

represents an independent article in a web page. It should only wrap content that can be plucked out of your page and distributed in a completely different context

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

what are and when should elements be used?

A

keeps our document outline the exact same while lending it some extra semantic structure.

like an , except it doesn’t need to make sense outside the context of the document. Though heading elements split the document into sections sometimes we need wrappers around the content.

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

what is a side effect of using

A

By adding those elements, we’re telling the document outline that it should be defined by the nesting structure of the elements instead of the heading levels. This basically means that each can have its own set of <h1> through <h6> headings that are independent of the rest of the page.

BUT due to screen readers and such it is better to use heading levels dispite using sections</h6></h1>

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

what should sections contain?

A

at least one heading element, otherwise it will add an untitled section to you document

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

lets you mark up the various navigation sections of your website. This goes for the main site navigation, links to related pages in a sidebar, tables of content, and pretty much any group of links.

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

denotes introductory content for a section, article, or entire web page.

Headers are only associated with the nearest sectioning element. This means that you can use multiple elements to add introductory content to different parts of a document

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

like headers, but come at the bottom. They are associated with the nearest section element

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

for tangentially related content

appropriate for highlighting definitions, stats, sidebars, advertisements, or quotations

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

represents either a time of day or a calendar date. Providing a machine-readable date makes it possible for browsers to automatically link it to users’ calendars and helps search engines

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

<address></address>

A

It defines contact information for the author of the article or web page in question. <address> should not be used for arbitrary physical addresses.</address>

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

represents a self-contained “figure”, like a diagram, illustration, or even a code snippet

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

what is the difference between and alt=””

A

alt should serve as a text replacement for the image, while is a supporting description displayed with either the image or its text-based equivalent.

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

how do you define a root-relative link?

A

they start with a forward slash ‘/search’

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

when should we use png?

A

use for anything that’s not a photo or animated

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

when should we use gifs?

A

when we need animation

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

when should we use jpg?

A

for photos, they do not support transparancy but are a smaller size with a large color range

17
Q

when should we use svg?

A

not great for images with lots of text but should be used as much as possible otherwise

18
Q

how do you write a media query?

A

@media screen only and (min-width: 500px) {}

19
Q

what does “screen only” mean in a media query?

A

The only screen “media type” means that the contained styles should only be applied to devices with screens (ie not on print)

20
Q

what does

do?

A

allows mobile devices to use mobile layouts (ie use @media queries)

21
Q

what does srcset do?

A

lets us present our high-resolution image only to retina devices, falling back to the low-resolution version for standard screens.

22
Q

how do we use srcset?

A

<img></img>

OR

<img></img>

23
Q

where does x1, x2 in srcsets fall short?

A

if the user has a retina smartphone, it’ll download the high-resolution image even when the standard version would suffice.

24
Q

when do we need to include the sizes attribute?

A

when using dimension bases srcsets

25
Q

when might we use a tag?

A

when we want to send in different images for different screen sizes. When we want to use webp or other image types with little support

26
Q

tag example

A

<img></img>

27
Q

responsive image recommendation

A

stick to the 1x and 2x version of srcset for images less than 600 pixels wide, use the srcset plus sizes method from the previous section for bigger photos, and reserve for when you’re trying to do something real fancy

28
Q

how can you target a text input in CSS?

A

input[type=”text”]