Quiz
CO1019 - CSS & JavaScript
Create a free account to finish this quiz
Save your progress and see your final score.
Already have an account? Sign in
Questions in this quiz (50)
1What does CSS stand for
- ACreative Style Sheets
- BComputer Style Sheets
- CCascading Style Sheets
- DColorful Style Sheets
2What is the correct HTML for referring to an external sheet
- A<link rel="stylesheet" type="text/css" href="mystyle.css">
- B<style src="mystyle.css">
- C<stylesheet>mystyle.css</stylesheet>
3Where in an HTML document is the correct place to refer to an external style sheet
- AAt the top of the document
- BAt the end of the document
- CIn the <body> section
- DIn the <head> section
4Which HTML tag is used to define an internal style sheet
- A<script>
- B<style>
- C<css>
5Which HTML attribute is used to define inline styles
- Afont
- Bclass
- Cstyles
- Dstyle
6Which is the correct CSS syntax
- Abody:color=black
- B{body;color:black}
- C{body:color=black(body)}
- Dbody {color: black}
7How do you insert a comment in a CSS file
- A// this is a comment //
- B' this is a comment
- C// this is a comment
- D/* this is a comment */
8Which property is used to change the background color
- Abackground-color:
- Bbgcolor:
- Ccolor:
9How do you add a background color for all <h1> elements
- Ah1.all {background-color:#FFFFFF}
- Ball.h1 {background-color:#FFFFFF}
- Ch1 {background-color:#FFFFFF}
- D#h1 {background-color:#FFFFFF}
10How do you change the text color of an element
- Atext-color=
- Bcolor:
- Ctext-color:
- Dfgcolor:
11Which CSS property controls the text size
- Afont-style
- Btext-style
- Ctext-size
- Dfont-size
12What is the correct CSS syntax for making all the <p> elements bold
- A<p style="text-size:bold">
- B<p style="font-size:bold">
- Cp {font-weight:bold}
- Dp {text-size:bold}
13How do you display hyperlinks without an underline
- Aa {text-decoration:none}
- Ba {underline:none}
- Ca {text-decoration: no underline}
- Da {decoration: no underline}
14How do you make each word in a text start with a capital letter
- Atext-transform:capitalize
- Btext-transform:uppercase
- CYou can't do that with CSS
15How do you change the font of an element
- Afont=
- Bf:
- Cfont-family:
16How do you make the text bold
- Afont-weight:bold
- Bfont:b
- Cstyle:bold
17How do you display a border like this:
Top border = 10px
Bottom border = 5px
Left border = 20px
Right border = 1px- Aborder-width:5px 20px 10px 1px
- Bborder-width:10px 20px 5px 1px
- Cborder-width:10px 5px 20px 1px
- Dborder-width:10px 1px 5px 20px
18How do you change the left margin of an element
- Atext-indent:
- Bmargin:
- Cindent:
- Dmargin-left:
19To define the space between the elements border and content, you use the padding property, but are you allowed to use negative valued
- ANo
- BYes
20How do you make a list that lists its items with squares
- Atype: square
- Btype: 2
- Clist-type: square
- Dlist-style-type: square
21Change the color of all elements with the class "colortext", to "red"
- A.colortext {color: red;}
- B#colortext {color: red;}
- Ccolortext {color: red;}
- D#colortext {color-all: red;}
22How do you set the top and bottom margins for all <h1> to "50px", and left and right margins to "25px"
- Ah1 {margin: 50px 25px 50px 25px;}
- Bh1 {margin: 50px 50px 25px 25px;}
- Ch1 {margin: 25px 25px 50px 50px;}
23Which of the following is true:
- AAn inline style is applied directly to an HTML element via the style attribute
- BEmbedded style are placed within a style element within the head section of an HTML document
- CIn "relative" CSS design, the sizes and positions of elements may change when the size of the window is changed
- DAll the above statements are true statements
24Given the following style sheet:
body {font-size: 10pt} h1{font-size: 130%}
and the HTML: <BODY> <H1> A <EM>large</EM> heading </H1> </BODY>- AThe 'font-size' property for the H1 element will have the computed value '10pt'
- BThe font size property for the H1 element will have the computed value '13pt'
- CAn error will show in the browser
25The "absolute length" units are fixed and a length expressed in any of these will appear as exactly that size
- ATrue
- BFalse
26Inside which HTML element do we put the JavaScript
- AGlobal variable
- BLocal variable
- CBoth of the above
- DNone of the above
27Inside which HTML element do we put the JavaScript
- A<javascript>
- B<script>
- C<js>
- D<scripting>
28What is the correct JavaScript syntax to write "Hello World"
- Adocument.write("Hello World");
- Bdocument.writeln(Hello World);
- Cdocument.innerhtml.write("Hello World");
- DInnerHTML.write("Hello World");
29What is the correct JavaScript syntax to change the content of the HTML element below:
<p id="demo">This is a deomnstration.</p>- Adocument.getElementByName("p").innerHTML = "Hello World!";
- Bdocument.getElementById("demo").innerHTML = "Hello World!";
- C#demo.innerHTML = "Hello World!";
- Ddocument.getElement("p").innerHTML = "Hello World!";
30Where is the correct place to insert a JavaScript
- AThe <head> section
- BThe <body> section
- CBoth the <head> and <body> section are correct
31What is the correct syntax for referring to an external script called "xxx.js"?
- A<script src="xxx.js">
- B<script href="xxx.js">
- C<script name="xxx.js">
32The external JavaScript file must contain the <script> tag
- AFalse
- BTrue
33How do you write "Hello World" in an alert box
- Amsg("Hello World");
- BalertBox("Hello World");
- CmsgBox("Hello World");
- Dalert("Hello World");
34How do you create a function in JavaScript
- Afunction:myFunction()
- Bfunction myFunction()
- Cfunction = myFunction()
- D<scrip function: myFunction()>
35How do you call a function named "myFunction"
- A<scrip function: myFunction()>
- BmyFunction()
- Ccall function myFunction()
- Dcall myFunction()
36How to write an IF statement in JavaScript
- Aif (i==5)
- Bif i == 5 then
- Cif i = 5
- Dif i = 5 then
37How to write an IF statement for executing some code if "i" is NOT equal to 5
- Aif i =! 5 then
- Bif (i != 5)
- Cif (i <> 5)
- Dif i <> 5
38How does a WHILE loop start
- Awhile i = 1 to 10
- Bwhile (i <= 10; i++)
- Cwhile (i <= 10)
39How does a FOR loop start
- Afor (i = 0; i <= 5)
- Bfor (i = 0; i <= 5; i++)
- Cfor i = 1 to 5
- Dfor (i <= 5; i++)
40How can you add a comment in a JavaScript
- A//This is a comment
- B'This is a comment
- C<!--This is a comment-->
- D<*--This is a comment-->
41How to insert a comment that has more than one line
- A<!--This comment has
more than one line--> - B/*This comment has
more than one line*/ - C//This comment has
more than one line//
- A<!--This comment has
42What is the correct way to write a JavaScript array
- Avar colors = "red, "green", "blue"
- Bvar colors = (1:"red", 2:"green", 3:"blue")
- Cvar colors = 1 = ("red"), 2 = ("green"), 3 = ("blue")
- Dvar colors = ["red, "green", "blue"]
43How do you round the number 7.25, to the nearest integer
- Arnd(7.25)
- BMath.round(7.25)
- CMath.rnd(7.25)
- Dround(7.25)
44How do you find the number with the highest value of x and y
- AMath.max(x, y)
- Btop(x, y)
- Cceil(x, y)
- DMath.ceil(x, y)
45What is the correct JavaScript syntax for opening a new window called "w2"
- Aw2 = window.open("http://www.le.ac.uk.co");
- Bw2 = window.new("http://www.le.ac.uk.co");
- Cw2 = window.Target("http://www.le.ac.uk.co");
- Dw2 = window.blank("http://www.le.ac.uk.co");
46JavaScript is the same as Java
- ATrue
- BFalse
47How can you detect the clients browser name
- Aclient.navName
- Bbrowser.name
- Cnavigator.appName
- Dbrowser.version
48Which of the following JavaScript code is correct
- A<script>document.alert(JavaScript says "Hello World!")</script>
- B<script>document.write('JavaScript says "Hello World!"')</script>
- C<script>document.alert('JavaScript says "Hello World!"')</script>
- D<script>document.write(JavaScript says "Hello World!")</script>
49Which of the following is correct to use the concatenate function in JavaScript
- Avar n = str1.conc(str2);
- Bstr1 = con(str2);
- Cvar n = str1.concatenate(str2);
- Dvar n = str1.concat(str2);
50Which of the following is a built-in function in JavaScript to show a system message
- Aalert("I am a message box");
- Bprompt("I am a message box");
- Cconfirm("I am a message box");
- DAll of the above are correct
Information
- Description
- Computer Science Quiz on CO1019 - CSS & JavaScript, created by Edmund Yong on 11/05/2017.
- Author
- Edmund Yong
- Language
- English
- Views
- 2
- Tags
- Rating
- No ratings yet Rate this quiz