- What does the server in the client server architecture do?
- What does the client do?
- What is an IP address?
- What is DNS?
- What is the difference between the Internet and WWW?
- Explain what HTML is
- Why does inline style CSS override rules defined in style elements and external stylesheets?
- Give a brief example of when to use ID (
#id
) and when to use classes (.class
) in CSS. - What does RGBA mean and what colors can you express with it?
- Why do we include CSS files inside the head element and not inside the body element?
- What CSS selector matches all the p elements inside the article element in the following HTML?
<p>This should not match.</p> <article> <p>This should match.</p> <p>This should also match.</p> <p>Do not forget about this one!</p> </article>
- What are the DRY and KISS principles of software design?
- What is the difference between
position: absolute
andposition: fixed
? - With CSS3, how do we access the third element within another element?
- Why do mobile phones usually ignore auto play on video elements?
- What will this CSS snippet do if the visitor is browsing on a device with
320x568
resolution?@media only screen and (min-device-width : 768px) and (max-device-width : 1024px) { #logo { display: none; } }
- Mention some of the advantages of having a single responsive website instead of dedicated versions like
m.til.no
for mobile andtil.no
for desktop?
- Why does the following expression
0.1 + 0.2 === 0.3
evaluate to false in Javascript? - What does the
method
attribute on aform
element decide? - Explain why the form fields appear in the URL when the method on form element is changed to
GET
? - Why is it considered bad practice to only validate form input with HTML5 and/or Javascript?
- When is it appropriate to use
textarea
overinput
?
- When calling
getContext('2d')
on a Canvas element, it will return a drawing context (i.e. the type of canvas) - in this case a two-dimensional context. How can we get a threedimensional context instead? - How would you create a blue circle using the Canvas element? Explain with words or code.
- What is a more terse (also known as shorter) way of writing the loop in the following using the
Array.filter
method?const countries = ['Norway', 'Sweden', 'Denmark', 'New Zealand']; const countriesStartingWithN = []; for (let i = 0; i < countries.length; i++) { let country = countries[i]; if (country.startsWith('N')) { countriesStartingWithN.push(country); } }
-
In CSS, you can override precedence rules by adding the ____ property to a style declaration.
A. !override
B. !main
C. !important
D. !priority -
What is the default value of the position property?
A. relative
B. absolute
C. fixed
D. static -
What is one advantage that HTML5 APIs offer for modern Web design?
A. They enable users to view Flash content on mobile devices.
B. They enable developers to create apps without coding skills
C. They enable older browsers to display any multimedia content
D. They enable users to view multimedia without plug-ins -
What is the result of the following code?
var y = Math.floor(3.8);
A. 3.8
B. 4
C. 3.5
D. 3 -
Graphics defined by SVG is in which format?
A. XML
B. HTML
C. CSS
D. Javascript -
What the following code will do if someone types in “18”?
var age = prompt("Enter your age "); var next = age + 1; alert("On your next birthday, you'll be "+next);
A. It gets an error
B. It displays "18"
C. It displays "19"
D. It displays "181" -
How do you select all p elements inside a div element?
A.div.p
B.div p
C.div + p
D.div * p
-
How do you display a border like this:
The top border = 10 pixels
The bottom border = 5 pixels
The left border = 20 pixels
The right border = 1 pixel
A.border-width:10px 1px 5px 20px;
B.border-width:5px 20px 10px 1px;
C.border-width:10px 5px 20px 1px;
D.border-width:10px 20px 5px 1px;
-
From outside to inside, a box (block) has:
A. border, margins, padding
B. margins, padding, border
C. padding, margins, border
D. margins, border, padding -
Which statement is true?
A. An XML document can have one root element
B. An XML document can have one child element
C. XML elements have to be in lower case
D. All of the above -
Which of the following statements is true? (2%)
A. JPG files are limited to 256 colors.
B. GIF files support 8 bit transparency.
C. Use GIF files for photographs.
D. GIF uses lossless compression algorithm -
Match each of the TCP/IP layers with the correct protocol.
Layer Protocol Application Layer IP Transport Layer WiFi Network Layer TCP Physical Layer HTTP -
What is the correct HTML for making a text input field?
A. <input type="textfield"> B. <textfield> C. <input type="text"> D. <textinput type="text">
-
How do you display hyperlinks without an underline?
A. a {decoration:no-underline;} B. a {text-decoration:none;} C. a {underline:none;} D. a {text-decoration:no-underline;}
-
What is the correct JavaScript syntax to change the content of the HTML element below?
<p id="demo">This is a demonstration.</p>
A. document.getElementById("demo").innerHTML = "Hello World!"; B. #demo.innerHTML = "Hello World!"; C. document.getElement("p").innerHTML = "Hello World!"; D. document.getElementByName("p").innerHTML = "Hello World!";
-
If you wanted to round the corners of a block element, which style property would you apply?
A. border: B. border-arc: C. border-deg: D. border-radius:
-
Consider the table shown below. Which line of code would create the last row of the table?
A. <tr><td></td><td rowspan=”2”></td></tr> B. <tr><td colspan=”2”></td><td rowspan=”2”></td></tr> C. <tr><td rowspan=”2”></td></tr> D. <tr><td colspan=”2”></td></tr>
-
How many alert boxes will the following loop produce?
for ( var Index = 0; Index <= 2; ++Index ) alert( Index );
A. 0
B. 1
C. 2
D. 3 -
Which of the following is the code for accessing the contents of an input box named
userData
on a form?A. document.forms[0].userData B. document.forms[0].userData.value C. document.forms[0].userData.contents D. document.forms[0].userData.data
-
Given a file structure in the figure below, if you are working on the source code of
index.html
, which of the following is the correct relative URL forlecture1.html
?
A.lecture1.html
B.lectures/lecture1.html
C.../lectures/lecture1.html
D../lecture1.html
-
The syntax for adding a textfield of 3 rows, each of width 40 is:
A. <textfield rowspan=”3” colspan=”40”>blah blah</textfield> B. <textfield rows=”3” width=”40”>blah blah</text> C. <text row=”3” width=”40”>blah blah</text> D. <textarea rows=”3” cols=”40”>blah blah</textarea>
-
Indicate whether each of the following statements is True or False.
A. The below is valid JSON.{ "id": 1, "name": "A green door", "price": 12.50, "tags": ["home", "green"] }
B. In an HTML form, the method attribute is used to specify the script file that processes the form data
C. Domain Name Servers map symbolic computer names to their host names
D. XML elements cannot be empty -
What is the output when you run the following programs:
var i = 25; var j = “25”; var k = 2 + “5”; var l = “2” + “5”; (a) document.write (i == j); (b) document.write (i === j); (c) document.write (j == k); (d) document.write (j === k); (e) document.write (i == k); (f) document.write (i === k); (g) document.write (k == l); (h) document.write (k === l);
-
The elements
<div>
and<span>
have the following characteristics:
A. Element<div>
inherits properties defined for<span>
in a stylesheet
B.<div>
and<span>
have no real meanings as html tags unless stylesheet is applied
C. Elements<span>
and<div>
define content to be inline or block-level
D.<div>
and<span>
are used as alternatives for the element<p>
E.<div>
is used inside element<p>
-
In regards to the CSS box model, where is the margin property located?
A. Inside the box
B. Outside the box
C. Inside or outside depending on where you put it in your code
D. None of the above -
Which built-in HTML5 object is used to draw on the canvas?
A. getContext
B. getContent
C. getGraphics
D. getCanvas -
Which primitive shape is supported by
<canvas>
?
A. Cycle
B. Rectangle
C. Polygon
D. Triangle -
While working on a JavaScript project, which function would you use to send messages to users requesting for text input?
A.Display()
B.Prompt()
C.Alert()
D.GetInput()
E.Confirm()
-
Which protocol is ideal for transmitting large files?
A. HTTP
B. FTP
C. SMTP
D. RTP -
In HTML tables, the number of columns is determined by:
A. how many<td>
elements are inserted within each row
B. the width attribute of the<tr>
element
C. the<col>
element
D. none of the above -
If you'd like visited links to be green, unvisited links to be blue, and links that the mouse is over to be red, which CSS rules will you use?
A. a:visited { color: green } a:unvisited { color: blue } a:mouseover { color: red } B. a:link { color: blue } a:visited { color: green } a:hover { color: red } C. a:hover { color: red } a:visited { color: green } a:link { color: blue } D. a:active { color: green } a:link { color: blue } a:hover { color: red }
-
From outside to inside, a box (block) has:
A. border, margins, padding
B. margins, padding, border
C. padding, margins, border
D. margins, border, padding -
The difference between margins and padding is...
A. indistinguishable if there's no border
B. margin does not have a background color
C. padding is measured inem
; margins inpx
;
D. there is no difference -
What is the default value of the
position
property?
A.relative
B.absolute
C.fixed
D.static
-
Which HTML attribute specifies an alternate text for an image, if the image cannot be displayed?
A.src
B.title
C.alt
D.longdesc
-
Indicate whether each of the following statements is True or False
A. This a "well formed" XML document:<?xml version="1.0" encoding="UTF-8"?> <book1> <isbn>1234567890</isbn> <name>XML Master Basic >2006<</name> </book1>
B. In a hierarchical structure, each page is linked with the pages that follow and precede it in an ordered chain
C. In HTML5<video>
element you don’t need to supply values for all attributes, eg.control
,loop
; these attributes are on when they are there and off in case they don’t.
D. Pseudo-class selects an element based on a state the element is in
E.POST
requests are never cached
F.GET
requests cannot be bookmarked -
Given a For loop counter of
for (var i = 1; i <= 5; i+=2)
, the counter values are:
A. 1 and 3
B. 1, 3, and 5
C. 5, 3, and 1
D. 1, 2, 3, 4 and 5 -
Among the following types of style rules, ____ has the highest priority.
A. User Defined Rules
B. External Style Rules
C. Embedded Rules
D. Inline Styles -
Which one of the following statements is False?
A. In JavaScript, identifier names are case sensitive.
B. JavaScript code can appear in both<head>
and<body>
sections.
C. External JavaScript file can be linked using the<link>
element.
D. JavaScript can be turned off by the users concerning of security. -
The style rule
li, em {color: blue}
indicates the content of ____ will appear in blue color.
A. Both<em>
and<li>
elements
B. Any<em>
elements that are inside a<li>
element
C. The first<em>
element that is inside a<li>
element
D. The<li em>
element -
Indicate whether each of the following statements is True or False.
A. HTML allows constructs that are not permitted in XHTML
B. GIF supports 8-bit transparency, meaning image can “fade-in” through partial transparency
C. Is this a "well formed" XML document?<?xml version="1.0"?> <note> <to age="29">Tove</to> <from>Jani</from> </note>
-
Indicate whether the sentence or statement is True or False:
A. An HTML file contains both formatting tags and content
B. The alt attribute in an<img>
element is often used to include a text description of the image, which displays for non-graphical browsers
C. By default a block level element will be displayed with a bordered box around it
D. CSS positioning is more advantageous than<table>
for page layout. -
In the URL
http://www.idi.ntntu.no/course/info.html#majors
, which part indicates an internal section of the page?
A.http://
B.www.idi.ntntu.no
C./course/info.html
D.#majors
-
The ____ element is used to mark a sectioning content/block within an HTML doc.
A.<nav>
B.<span>
C.<div>
D.<class>
-
Which of the following is NOT an inline element?
A.<img>
B.<input>
C.<span>
D. None of the above -
Which of the following statements is True?
A. JPG files are limited to 256 colors.
B. PNG files only support 1 bit transparency.
C. GIF is a good format for photographs.
D. PNG uses the DEFLATE lossless compression algorithm.
{% include gotop.html %}