HTML/CSS Flashcards

1
Q

What is HTML

A

Hyper Text Markup Language. It provides a structure and content to a webpage

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

What is the HTML5 doctype declaration?

A

!DOCTYPE

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

List some tags. What is it used for?

A

div - block element used to hold other elements or text
headings - h1-h6 used to create headings of varying sizes
p - used to create plain text
img - used to insert an image into HTML
a - Anchor - used to create a link
span - used inside a container and is used to mark up a part of the doc

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

What are the required tags for an HTML document?

A

HTML
HEAD
TITLE
BODY

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

What is the tag for an ordered list? unordered list? Change bullet styling?

A

ol - ordered list, numbered list

ul - unordered list. Use the property using css or html. list-style-type

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

Do all tags come in a pair? List a self-closing tag.

A

Not all tags come in pairs, some are closed in the same tag that calls them

Some Include
col - a column in a table
br - create a line break
hr - creates a horizontal line
img - used to define an image
link - mostly used to add external stylesheets in the head
source - used to give multiple media resources for audio, video, and pictures

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

What’s the difference between an element and an attribute? List some global attributes.

A

HTML element holds the content. HTML attributes are used to describe the characteristics of an HTML element in detail.

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

What is the syntax for a comment in HTML?

A

Opening Angle Bracket
Exclamation Point
dash dash

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

What tags would you use to create a table? A navbar? What about a form?

A

table tag - followed by tr for rows, th for data heading, and td for data

nav tag - used with a tags to create navigation links

form tag - used with inputs to pass user-data

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

What’s the difference between a class and id?

A
An ID is only used to identify one single element in our HTML.
A class can be used to identify more than one HTML element.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

How would you include CSS into an HTML document? What about JS?

A

script for js and style for css

Both can be implemented from a specific js or css file by adding them in the head

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

What is a semantic tag? What about formatting tags/elements?

A

Semantic HTML tags provide information about the contents of those tags that goes beyond just how they look on a page.
Formatting tags are used to make text bold, italicized, or underlined.

Non-Semantic : div, span
Semantic: article, footer, header, main, nav, summary
Formatting: b, i, strong, mark

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

What’s the difference between a block and an inline element?

A

Inline elements occupy only sufficient width,dont start new lines, and don’t have top/bottom margins.
Block elements occupy full width of page, always start in a line, have top and bottom margins

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

What is CSS? what are the different ways of styling an html file?

A

Cascading Style sheets. It can be added in 3 ways: inline-by using the style attribute in HTML elements, Internal-by using a element in the section, and External-by using an external CSS file.

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

Which way has highest priority when styles cascade: inline, internal, and external stylesheets. Which is best practice? Why?

A

Inline has the highest priority, any styles that are defined in the internal and external style sheets are overridden by Inline styles.

Inline mixes content and presentation, so it is best to use it sparingly
Internal should only be used when a specific document has a unique style
external is the best practice as it separates content and presentation and can be used for multiple documents

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

What are the different CSS selectors? Write the syntax for each.

A

.class
#id
*
Element

17
Q

What is a psuedo-class? What is the syntax for selecting that?

A

EX: button:hover {}

A psuedo-class is a keyword added to a selector that specifies a special state of the selected elements

18
Q

Can I select multiple elements at once with CSS? If so, what is the syntax?

A

Yes you can select multiple elements at once.

The * selector selects all elements. > , to select specific different elements

19
Q

Explain the concept of specificity and how it relates to styling conflicts

A
Specificity is the means by which browsers decide which CSS property values are the most relevant to an element and therefore will be applied. Specificity is based on the matching rules which are composed of different sorts of selectors
type selectors > class selectors > id selectors
!important overrides specificity
20
Q

Explain the CSS box model

A

The box model is essentially a box that wraps around every HTML element. It consists of Margins, Borders, Padding, and the actual content

Content - Content of the box
Padding - area directly around the content
Border - border around the padding
Margin - area outside the border

21
Q

What features did CSS3 introduce?

A
Rounded Corners
Shadows
Gradients
Transitions/Animations
Mini Columns
Flexible Box
Grid Layout