Introduction to HTML, CSS, & JavaScript Flashcards

(103 cards)

1
Q

Discuss the history and objectives of HTML (4)

A

1 HTML stands for HyperText Markup Language;

2 enables documents to be displayed as web pages on the Internet.

3 Tags represent the elements of an HMTL page like paragraphs, lists, and tables.

4 HTML5, the latest version, supports:

a pages written in HTML or XML syntaxand markup
b APIs for web storage, video, and audio content
c also works across devices and with earlier HTML versions

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

explain HTML (2) vs XHTML (3)

A

XHTML:
1 needs all lowercase tags
2 must be well-formed or the parser will stop processing
3 advantage = more strict syntax rules so easier to maintain/less room for error

HTML:
1 case-insensitive
2 unmatched quotations and non-terminated/uncontained elements are allowed

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

define the HTML DOM Tree

and explain its purpose

A

“Document Object Model” = data representation of the objects that comprise the structure and content of a document on the web.

serves as an interface between HTML and scripting languages like JavaScript, enabling dynamic interactions with the document

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

Describe how HTML uses APIs. (4)

A

When a webpage loads in the browser, it becomes a Document object.

The Document object lets you access and control everything on the webpage using JavaScript.

The DOM (Document Object Model) is like a tree that shows all the elements on the webpage. JavaScript can use this to find and work with parts of the page.

To get or change something on the page with JavaScript, you start by using the document object. For example: document.getElementById(“header”) finds the element with the ID “header.”

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

explain html5

  1. syntax compatible with…?
  2. new and refined…?
  3. HTML web apps have…?
A

1 syntax compatible with HTML4 and XHTML1

2 new and refined APIs for video and audio elements, offline web apps, and drag and drop

3 HTML5 Web Applications have:
a Improved search indexing with meta tags,
b better page load times,
c enhanced user experience,

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

define scripting (1)

explain how browsers enable scripting (4)

A

1 scripting refers to writing code, typically in JavaScript, that interacts with the elements of an HTML document to make the webpage dynamic and interactive.

2 can be done directly within your HTML code within the script tag, or within a separate file which is called in your HTML code.

3 It can be used for various tasks, such as form validation, dynamically changing the content of a website, and manipulating images.

4 Since scripting can be turned off, the recommendation is to use scripting but not to rely on it.

5 Scripting is enabled when certain browser conditions are met.

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

what is html5 sandboxing and how does it work? (2)

A

1 Sandboxing an iframe is a way to limit the permissions that an iframe can run with. HTML5 isolates the iframe’s content from the parent document

3 This sandboxed browsing context can be set at the
page level or specified as an attribute for embedded objects.

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

Outline how HTML is supported by common browsers.

A
  • old versions of certin browsers do not support certain features
  • caniuse.com
  • you can use JavaScript to check whether a certain HTML5 element is supported by a browser.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

LIist some of the features of HTML5,

A

HTML5
includes features for categorizing sections of web pages, and managing data, video and
audio tools.
Enables you to develop a single, cross-browser application for the web and portable devices.
and helps you to create a more engaging user experience.

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

Define parsing vs processing

A

Parsing

Parsing is the act of analyzing and breaking down input data (like text, code, or a file) into smaller, understandable components.
For example, when a browser reads HTML, it parses the text to identify tags, attributes, and content, forming a structured representation (the DOM tree).

Processing

Processing is the step that follows parsing, where the program takes the structured data and performs actions or computations with it.
For instance, after parsing the HTML, the browser processes it to render the webpage, apply styles, execute scripts, and respond to user interactions.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

describe the Document Object Model or DOM tree,

A

The DOM tree is an in-memory representation of a document.
DOM trees contain nodes, which define the type
of document and its structure, such as
headers and paragraphs, text nodes, and comment nodes.

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

list some HTML document API properties
and methods, describe how scripting is enabled in browsers,
describe browser support for HTML5 features.

A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q
  1. Use titles and headings to label information
    1. Insert text using the paragraph element
    2. Insert line breaks on a page
    3. Add links to different sections of a page and other pages
    4. Create a list of items
    5. Add a table of data
    6. Insert an image
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

how do you always have to start an html document?

A

must always start by specifying the DOCTYPE. The entire content is then enclosed within an <html> tag

eg <!DOCTYPE html>

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

what does the head tag do?

A

The <head> tag contains all the metadata about the page: This information may include the document title, character set, styles to be used, scripts, etc.

Contents of <head> section are not displayed to the user.

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

what is the purpose of the body tag?

A

<body> tag contains the content that is displayed to the end user.
</body>

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

what is the title of a page, where is it displayed, and how do you format it?

A

The title of the page appears on the browser tab when you open a webpage in the browser.

using the <title> tag, which is placed within the <head> section of your HTML markup:</title>

<head>
    <title>Sample Page Title</title>
</head>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
18
Q

explain headers

A

HTML defines six different font sizes for headings. Each heading represents a different level of importance and text size

<h1> through <h6>

should be placed in <body> as follows:

<body>
<h1>Most Important (and Largest) Heading</h1>
<h6>Least Important (and Smallest) Heading</h6>
<body>

NOTE: cannot be placed within <address>, <footer>, or other <header> elements.
</header></footer></address></body></body></body></h6></h1>

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

explain <p> tag

A

<p> tag should be used to insert text into your HTML document. stands for paragraph and includes any text content, whether it is a single word or a 10-page essay.

<body>
<h1>Most Important (and Largest) Heading</h1>
<p>This is some text. The content within this paragraph element can be as short or as long as needed.</p>
<h6>Least Important (and Smallest) Heading</h6>
<p>This is another paragraph of text.</p>
<body>
</body></body></p>

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

explain <br></br> tag

A

A line break is used to complete one line and continue the remaining text
at the start of a new line,

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

explain how to hyperlink text

A

<a> tag defines a hyperlink in HTML, followed by the href attribute to define the destination address of the hyperlink.</a>

 <a href="https://www.ibm.com">IBM</a>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

how do you get a link to open in a new tab?

A

target=”_blank” before the hyperlink text

<a>IBM</a>

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

how do you link to a different section in the same page?

A

either of the following two ways:

1
2

 <a href="#">Top of Page</a>
 <a href="#top">Top of Page</a>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
24
Q

explain linking to a diff section within a page and how you label them

A

o link to a different section of the page, you can use the id of the section you want to link to, as follows:

1
2
3
4
5

 <a href="#section">Link to section</a>
 ...
 <h1 id="section">Section</h1>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
how do you create a list of items?
use the
    (ordered list) tag for numbered lists and the
      (unordered list) tag for bulleted lists.
26
how do you represent one item on a list?
Each point within a list will be enclosed by a
  • opening and closing tag, which represents a list item. This same tag is used for both ordered and unordered lists.
  • 27
    how do you represent the data within a table? (3)
    1 each row of data is represented using the (table row) tag. 2 The column or row headings can be specified by the (table heading) element. 3 each data element within the table cells is specified using the (table data) tag.
    28
    how do you create a table? how is it formatted in the code?
    A table is created with HTML using the tag. NOTE: does not display a border by default.
    Heading 1 Heading 2 Heading 3
    H1 - Data Item 1 H2 - Data Item 1 H3 - Data Item 1
    H1 - Data Item 2 H2 - Data Item 2 H3 - Data Item 2
    H1 - Data Item 3 H2 - Data Item 3 H3 - Data Item 3
    29
    how do you add an image?
    1 Images can be added within a web page by using the tag. 2 to add an image, you need to know the image file name and include it in the ‘src’ attribute, which specifies an external resource that you want to link, such as the URL or file path of an image NOTE: the file path of the image relative to the location of your HTML file. 3 tag also requires the ‘alt’ attribute, which defines alternative text to be displayed in the event the image cannot be loaded and when a screen reader is used. 4 The size of an image can also (optionally) be specified using the ‘width’ and ‘height’ attributes, with the numbers listed in pixels.
    30
    what does the skeleton of an html document look like?
    31
    what ae the 2 types of css layouts to design websites?
    fluid and fixed
    32
    what do html5 sandboxes help manage?
    iframe mashups (???)
    33
    what is xml?
    An “eXtensible Markup Language” Designed to store and transport data allowing users to define their own markup languages, primarily to displaydocuments on the web.
    34
    what is XHTML?
    An “eXtensible Markup Language” Designed to store and transport data allowing users to define their own markup languages, primarily to displaydocuments on the web.
    35
    What are web storage apis?
    APIs that allow data storage in a browser.
    36
    explain div tag
    ften used to separate sections in the body of a document in order to style that content with CSS. no particular semantic meaning When using a
    tag, note that browsers will insert a line break before and after the element.
    37
    how do you comment in html?
    This tag denotes a comment in HTML, which is not displayed by a browser but can be useful to hide and document code. 1
    38
    tag
    Used to link an external document, such as a CSS file, to an HTML document.
    39
    tag `
    Used to provide metadata about the HTML document. 1 2 3
    40