134-web-technologies Flashcards

1
Q

HTML (Hyper Text Markup Language) -

A
  • standard markup language for creating n defining web pages.
  • Structural layer, describes structure + order of webpage and the text and images to browser.
  • browser reads, n interpret html tags to render web page visually for viewer
  • HTML document made up of head (contains metadata: title, character set, styles, scripts etc) and body (page contents)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

HTML elements and attributes

A

elements: building blocks of HTML pages, defines web page. Consist of start n end tags. Can have attributes (provides additional info about element) that come in name-value pairs e.g charset=“utf-8” (name=“value”)).

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

HTML tag <html>

A

goes at top of page to let browser know it’s a HTML file. All code written within is interpreted as HTML. Closing tag ends file. <html> </html>

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

HTML tag <link></link>

A

links external CSS file so style can be saved on another sheet (same style sheet can be used for multiple HTML pages). <link rel=“stylesheet” href=“style.css” /> href is the path to file

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

HTML tag <title></title>

A

metadata tag. puts title in browser window bar/tab (not on page) <title> </title>

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

HTML tag <body>

A

main content (headings, paragraphs, images, hyperlinks, tables, lists etc) that’s not metadata. <body> </body>

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

HTML tag <h1> <h2> <h3>

A

heading tags. h1 is the biggest, h6 the smallest. <h1> </h1>

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

HTML tag <img></img>

A

used to import/embed a picture. e.g <img src =“picture.jpg” width=“500px” height=“500px” />

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

HTML tag <head>

A

<head> </head>

container for metadata about the html document

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

HTML tag <a></a>

A

hyperlink to another page <a href=“contactus.html”> Click to contact us! </a>

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

HTML tag <div>

A

used for divisions of areas (like invisible boxes) in a page and can apply different styles to each part e.g borders, background colours for the divs. Can give it a ID to be referenced in JavaScript. E.g id=“mydiv”> Here is a div</div> or <div class=“introclass”>

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

HTML tag <form>

A

to create an input form. <form> <label for=“fname” > first name: </label> <input type=“text” id=“fname” name=“fname” placeholder=“enter name here”> </form> <br></br> can be used inside <form> to create blank lines between input boxes

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

HTML tag <input></input> for form

A
  • <input type=“text”> for single line text input, can replace “text” with “radio” for radio button (for one of multiple choices), or “checkbox” for ticking choices, or “submit” for displaying a submit button, or “button” for displaying a clickable button
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

HTML accessing a input element with type “submit” -

A

var x=document.getElementById(“mySubmit”);

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

HTML tag <p>

A

<p> makes a paragraph with a line space above and below, text is entered between </p>

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

HTML tag <ol>

A

ordered list (basically a list with numbers/alphabets instead of bullet points). Each element in list is defined with <li> tag. E.g <ol> <li> Dog </li> <li> Cat> </li> <li> Mouse </li> </ol> would look like 1. Dog 2. Cat 3. Mouse

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

HTML tag <ul>

A

unordered list (uses bullet points). Each element in list is defined with <li> tag. <ul> <li> Fish </li> <li> Cabbage </li> <li> Duck </li> </ul> would look like • Dog • Cat • Mouse

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

HTML tag


A

for JavaScript code, placed in <head> tag <script type=“text/javascript”> alert(‘test’);

 or if want to link external js file <script src=“/myscript.js”>
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
19
Q

HTML identity (id) attribute

A

unique id given to an element on a web page to point to a specific style declaration (can only be used by one html element within a page). Or used by JavaScript to access/manipulate the element with the id. defined in head tag or external css file. Uses #. E.g #m1 { color:white; font-family: Arial; background-color:black; } <h1 id=“m1”> testing </h1> the properties of the id are in the { }

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

HTML class attribute

A

can be used by multiple HTML elements. Defined in <head> tag or external css file. Uses the dot: . Example: .m1 { color:white; background-color:black; } <h1 class=“m1” > Hello World </h1>

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

CSS (cascading style sheets)

A
  • describe style of a webpage (tells browser how HTML elements are displayed/presentation layer).
  • uses selectors classes and ids etc
    -to define the formatting of a website
    to change the formatting depending on a device
    to give a consistent look to every page
    to set the formatting
  • if multiple styles have been applied to the same element, it will take on the last style sheet - however, follows a cascading order: all styles in a page will cascade into a new style sheet with inline style being the highest priority, then external/internal style sheets in head, then browser default. Inline has highest priority so will override the external/internal/browser ones on the same element.
  • can be placed within HTML or externally in a file
  • Allows developers to control layout of multiple elements/web pages at once (using ids and class/external css).
  • Forms: inline CSS, internal CSS, external CSS.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
22
Q

Inline CSS style

A

to apply a unique style for a single element. Defined in body tag. E.g <h1 style=“color:blue; text-align:center;” example</h1> <div style= “border: 1px solid black; color: red”> example </div>

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

Internal CSS style sheet

A

used if a single HTML page has a unique style, but for multiple elements. Defined inside <style> element inside <head> section. E.g <head> <style> body { border:-style:dotted; border-color:blue; } h1 { color:maroon; margin-left: 40px; } </style> </head></style>

24
Q

External CSS style sheet

A

can be used for multiple elements for multiple pages for the same style. Defined inside <head>, external CSS sheet is linked with <link></link> tag . E.g <link rel=“stylesheet” href=“mystyle.css”> mystyle.css could have body { color:#34ee34; } #m1 { font-size:24px; } border:-style:dotted; border-color:blue

25
CSS property background-color
sets background colour of an element, can use predefined colpur names or hex values. E.g background-color: #ff33ee or background-color: purple
26
CSS property border-color
sets colour of a border. can use predefined colpur names or hex values. Only works if border style is set too. E.g border-color: #ff33ee or border-color: purple
27
CSS property border-style
Changes style of a border. Options are solid, dashed, dotted, double, groove, ridge, inset, outset, hidden. E.g border-style: solid;
28
CSS property border-width
sets width of border, usually in px (pixels). Need to have border style before using width. E.g border-width: 3px;
29
CSS mixed borders
- a mixed border example: border-style : dotted solid double dashed; (top would be dotted, right is solid, left is double, bottom is dashed). Can be mixed for color and width too and is up to changing 4 sides for each. E.g border-style: solid double (would make top + bottom solid, and right + left double). Border-style: solid double dotted (top think right + left double, bottom dotted).
30
CSS property color
e.g sets colour of the text. color:white
31
CSS property font-family
sets the font. Can list multiple fonts so if first choice isn’t installed on user’s computer, the fonts cascade down the list and display the one that is. font-family: arial, helvetica
32
CSS property font-size
sets size of text. font-size:20px
33
CSS property height
sets height of an element. Can be in pixels (px), percentage of the parent (%), relative to the viewpoint (vw) or etc. height: 20%
34
CSS property width
sets width of an element. Same as height for what it can be in. width: 200px
35
JavaScript
programming scripting language, adds interactivity to web pages (behaviour layer - allows users to interact with page content) Interpreted rather than compiled as runs in a web browser on many different platforms w/ many different CPU architectures (web pages interpreted by browser each time they are loaded). Often used to validate input data on the client computer so local computer can deal with invalid data before it’s sent off to servers, eases load on busy server n reduces web traffic. Can use to calculate and manipulate data too.
36
JavaScript inputting data (php files)
action attribute tells browser to send any submitted form data to a page on server called action_page.php. The pho files handles the server’s processing of the form data.
37
JavaScript inputting data (simple)
- simple text boxes and buttons defined using input tag and the attribute determines type of input. Text box: type=“text” and a submit button would be: type=“submit”. Inputs are given an id (variable, can refer to it using JavaScript).
38
JavaScript outputs (method-1 changing the inner HTML of an element)

document.getElementById(“example”).innerHTML=“This is the output”;
39
JavaScript outputs (method 2 - button)
- when clicked, willl trigger the JavaScript code inside the