1.3.4a HTML, CSS, JavaScript Flashcards

You may prefer our related Brainscape-certified flashcards:
1
Q

How is a HTML document formatted?

A

Starts with html tags and ends with /html tags
Head includes things like title
Body includes what is displayed on the webpage

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

How do you display the title of a webpage in HTML?

A

Use the (title) and (/title) tags within the head.

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

How do you create a heading in HTML?

A

Use the (h1), (h2), (h3) etc tags

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

How do you create a paragraph in HTML?

A

Use the (p) tags.

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

How do you add an image to a webpage using HTML?

A

(p) (img src=”filename” alt=”cannot load image” height=”200” width=”200”) (/p)

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

How do you add a link to a webpage using HTML?

A

This (a href =”hyperlink”) CLICK (/a) is a link.

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

How do you create lists in HTML?

A
Use the (ol) and (/ol) tags to start and end an ordered list.
Use the (ul) and (/ul) tags to start and end an unordered list.
Use the (li) and (/li) tags at the start and end of each list item.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is CSS used for?

A

Allows developers to control the layout of multiple webpages at once.

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

Why is it better to write CSS code in a file separate from the HTML file?

A

If you write CSS code in the HTML file using the (style) tag, it will only affect the style of that page.

If you use external files, you can change the look of an entire site by amending 1 file.

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

How do you change the style of attributes within a HTML document using CSS?

A

(h1 style=”color:red;”) Text (/h1)
(h2 style=”border-style:dotted; border-color:blue”;) Text (/h2)
(h3 style=”font-family:Arial”;) Text (/h3)

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

How do you change the style of attributes in a webpage using an external CSS file?

A
h1{
---------- color:red;
---------- background-color:yellow;
---------- border-width:thick
}

h2{
——— font-family:Arial;
}

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

How do you link an external CSS file to a HTML document webpage?

A

In the head tag use:

link rel=”stylesheet” type=”text/css” href=”MyCSS.css”

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

How do you create a class in CSS?

A

In an external CSS file:

.classname {
——– color:red;
——– font-size:25px;
}

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

How do you link a class from an external CSS file using HTML?

A

(div class=”classname”)

/div

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

How do you create an identifier in an external CSS file?

A
#identifername {
-------- color:red;
}
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

How do you link an identifier from an external CSS file to a HTML file?

A

(ol id=”identifiername”)

17
Q

How do you create a text input box and a submit button using JavaScript?

A

In the head tag:

(form id=”form1” action=”/action_page.php”)
——– (label for=”forename”) Forename: (/label)
——– (input type=”text” id=”forename” name=”forename”) (br) (br)
——– (input type=”submit” id=”Submit” name=”Submit” value=”Submit”)
(/form)

18
Q

How do you create a button which references a JavaScript code in HTML?

A

(button onclick=”myFunction()”) Text (/button)

p id=”output here”) (/p

19
Q

Many normal C# habits of coding work in JavaScript. But how are variables defined and how are outputs given?

A

Variables are defined using ‘var’

document.getElementById(“output here”).innereHTML = text;

20
Q

How do you define a script in JavaScript within HTML and how do you directly write to the document.

A

Scripts are defined using (script) and (/script)

You can write directly to the document using document.write(“Text”);
You can create alert boxes directly using alert(“Text”);