HTML Basics Flashcards

(54 cards)

1
Q

What’s an ID? how often can it be used?

A

ID = way to mark a code in HTML for CSS. Only one ID value per document.

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

What’s a class? How often can you use it?

A

Way to mark an element in HTML for CSS. Can be used multiple times.

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

ID vs class?

A

ID value = x1 use

Class value = x many many times. Good for grouping.

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

What is the lowest specificity weight? How much?

A

Tags are only one point

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

Which thing in HTML has the highest specificity weight? How much?

A

An inline style = 1000pts

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

Rank the following in specificity points: how many each?

ID, class, tags

A
ID = 100 points
Class = 10 points
Tags = 1
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What examples of inline styles worth 1000 specificity points?

A

!important (bang important)

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

What’s a bang important? How and where to write it?

A

Bang important = most important code in your sheet for CSS.

Write in VSS declaration after value:
Color: red !important;

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

When’s the only time you should bang important?

A

Right before a deadline to string quick CSS together.

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

What’s an element? Give an example code.

A

Element = name of your structure. Ex. A, p, div

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

What are tags?

A

Carrots/ brackets + element

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

What are HTML attributes? Where do they go? Write example.

A

Gives more information to an element.
Go inside OPENING tag.
Ex. <a>click here</a>

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

What are all important structures in an HTML document. (From start to finish)

A
!DOCTYPE html
Html
Head
Body
/html
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What part of an HTML document tells us what version of the HTML it is? Where does it go?

A

The document type declaration or doc type, “!DOCTYPE html” goes @ top first.

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

What are semantics

A

Meaning/purpose behind an HTML content

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

What 2 elements in HTML have NO semantic value (only for styling purposes)

A

DIVs and Spans

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

Block vs inline elements

A

Block start on their own line and stack on each other. For bigger content.
Inline start at next space in a content line. For smaller content.

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

Can Block elements wrap inline elements? What about the opposite?

A

Yes. And no.

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

How to write an HTML comment?

A

<!—content—>

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

Difference between strong & b element

A
Strong = strong semantic importance
B= stylistically different text
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
21
Q

You want to make “study” bolded and important in the following HTML. How do you write?

P< it’s really important to study every day >

A

P < its really important to < strong > study < / strong > every day < / P > < / strong >

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

What 2 elements to italicize text in HTML? How are they different?

A

< em > = stressed emphasis

< i > = alternative voice or tone * good for quotes

23
Q

You want to group some content at the TOP of your webpage. What structure element to use?

24
Q

You want to group some content at the BOTTOM of your webpage. What structure element to use?

25
Header vs head vs h1
``` Header = content at top of page Head = meta data H1 = important content title ```
26
You want to make a section for navigation links, table of contents, previous/next links… what section element to use?
< nav >
27
What’s an article element?
< article > = For text that can be used independently. (Ex. Blog posts)
28
what is the best content to use for < aside > elements?
Sidebars, notes, brief explanations, “tips” sections, inserts
29
Where to find codes for special characters in HTML?
Copy paste character.com
30
How to code a hyperlink
< a href= “website url” > content < / a >
31
Can you make an entire block of content, a hyperlink? How?
Yes. Use anchor element < a >
32
What are two common types of links
To other pages | To other websites
33
Another name for href
A path
34
What href (path) to put when linking to another page on the same website?
Use a RELATIVE path. Href = “file NAME of link page”
35
Relative vs absolute paths (hrefs)
Relative = direction to file name or page Absolute = exact address
36
How to create an email link in HTML
Href = “ mailto: davidaych@gmail.com”
37
How do you program a subject into an html email hyperlink?
After the email hyperlink, write: ? Subject=content Spaces = %20
38
How to add a body to an html email hyperlink?
If subject is coded, attach w/ & If no subject coded, attach to hyperlink via ? Code: body=content Space = %20 Enter= %0A
39
How to code a hyperlink to open in a NEW window. Give example
``` Attribute = target Value = _blank ``` Ex. < a href= “website URL” target= “_blank” > content < / a >
40
How do you link to different parts of the same page?
Put your ID in your destination Chose your hyperlink location and Put your ID in it. Ex: < a href= “# ID name” > content < / a >
41
Does letter casing matter in HTML? What’s the best practice?
No. General practice = all lower case
42
What parts comprise an element?
Open and closing tag + content
43
What types of elements should you always include the head of your html? Describe each.
< meta charset= " utf-8 " > for character sets < title > for tab titles
44
Why do some tags not need a closing tag? What are these called?
Because the tag itself is already the content (ex. An image tag). These are called self-closing tags.
45
Why is it important to follow HTML rules? (3 reasons)
1. Better user experience (ex. Broken image link will still show image label) 2. Accessibility (ex. Screen readers) 3. SEO - search engine optimization (better result in google searches)
46
What is the shortcut to creating an HTML document structure?
Save doc as an HTML document. At top, write HTML and click “HTML 5”
47
What is the progressive enhancement concept? Why is it important?
Think of an Peanut M&M Core of website = content (HTML) Chocolate coating = presentation (CSS) Thin candy wrap = client-side script (JS) Not everyone has good access. Remember this model to build max accessibility for all.
48
What meta data should you always include in your HTML documents? Where do you write it?
Character sets, description, title, links.
49
How do you code character sets into your HTML? Where?
In the head: < meta charset = “ utf - 8 “ >
50
How do you code a description for your webpage that won’t be visible to visitors?
In head; < meta name = “ description “ content = “ write your description “ >
51
How do you code keywords into your html for search engine optimization?
In head: < meta name = “ keywords “ content “ word 1 , word 2, word 3… “ >
52
How do you write the title for your page to show on the browser tab?
In head: < title >
53
How and where do you set the language of your html doc?
In root tag (html) < html lang = “ en “ >
54
What image formats are the most supported across all browsers? How are they different?
Gif, jpg, png ``` Jpg = best quality photos PNG = lower color/transparency. Great for icons or background patterns. ```