7. Beginner Guide to HTML & CSS Flashcards

1
Q

HTML

A

Hypertext Markup Language

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

HTTP

A

Hypertext Transfer Protocol

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

Elements

A

Designated that define the structure and content of objects within a page

(e.g., headings <h1>, paragraphs </h1><p>, etc…)</p>

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

Tags

A

The syntax wrapped in angle brackets that represent elements.

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

Opening tag

A

Marks the beginning of an element, and consists of: a left angle bracket, element name, and right angle bracket. (E.g., <div>)</div>

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

Closing tag

A

Marks the end of an element, and consists of: a left angle bracket, a forward slash, the element’s name, and a right angle bracket. (E.g., )

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

Attributes

A

Properties used to provide add’l info about an element.

(E.g., id, which identifies an element; class, which classifies an element; src, which specifies a source for embeddable content; href, which provides hyperlink reference to a linked resource)

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

Selectors

A

Designates exactly which element(s) to target and apply styles to.

E.g., ‘p’ is the selector and has the ‘color’ property set to a value of ‘orange’:

       p {
           color: orange;
       }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Properties

A

Determine the styles that will be applied to the element; found inside of curly brackets and preceding a colon.

E.g., The ‘color’ property has the value ‘orange’ for the ‘p’ selector:

       p {
           color: orange;
       }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Values

A

The text btw the colon and semicolon that dictates the behavior of the property it follows.

(E.g., ‘orange’ is the value of the ‘color’ property of the ‘p’ selector:

       p {
           color: orange;
       }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

Type Selectors

A

Target elements by their element type.

E.g., to target all division elements, use the type selector ‘div’:

    div {
           color: light blue;
    }
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Class Selectors

A

More specific than type selectors, as they select a group of elements; select an element based on the element’s class attribute value; are preceded by a ‘ . ‘

E.g.,
(HTML)

<div>...</div>

<p></p>

(CSS)
.awesome {

}

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

ID Selectors

A

Even more precise than class selectors, they target only one unique element; uses an element’s I’d attribute value as a selector; preceded by a ‘#’ symbol.

E.g.,

(HTML)

<div>...</div>

(CSS)
#shayhowe {

}

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

Why is it best practice to use a single external style sheet?

A

It allows for styling to be cohesive across an entire website and for changes to styling to be made quickly sitewide.

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

Where do you reference a style sheet in an .html document?

A

In the head element.

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

How do you reference an external style sheet in an .html document’s head element?

A

It is linked to the .html doc with a link tag, a relationship attribute of stylesheet, and a hyperlink reference attribute to dictate the path to the stylesheet file

(the filename is all that is needed in practice, as the stylesheet is located in the same place as the .html document when uploading site contents to the web).

E.g.,

17
Q

What is a CSS reset?

A

It is a block of CSS code at the beginning of a stylesheet, used to tone down the default styling of the web browser reading the .html document, allowing each element to be styled from the same base.

18
Q

Margin

A

The space between an elements border and surrounding elements.

19
Q

Padding

A

The space between the element and its border.

20
Q

What happens when an element’s margin is set to a negative value?

A

The element grows larger

21
Q

What does Inheritance refer to in HTML?

A

The styling of elements based on their parent element’s styling. If not given their own selectors, classes, or ids, the element inherits the styling of its parent.

22
Q

Which attribute takes precedence in styling, class or id?

A

id is specific to one single element, and always takes higher presence than class styles.

23
Q

If an element belongs to multiple classes, how does the browser determine which styles to apply within the classes?

A

It chooses whichever class was declared last.

24
Q

What is the only way I’d styles are overridden?

A

Inline styling

25
Q

How can all styles be overridden, even when id and inline are declared?

A

Placement of the keyword ‘!important’ after the value declaration and before the semicolon of the style you want to ensure overrides.

26
Q

How do you comment out text in HTML?

A

open a comment with ‘ ‘

27
Q

How do you comment out text in CSS?

A

open a comment with ‘ /* ‘, close one with ‘ */ ‘