Quiz on CSS and PHP

Description

Computer Science Quiz on Quiz on CSS and PHP, created by Jimit Thakkar on 22/10/2017.
Jimit Thakkar
Quiz by Jimit Thakkar, updated more than 1 year ago
Jimit Thakkar
Created by Jimit Thakkar about 7 years ago
110
1

Resource summary

Question 1

Question
In CSS the selector .par matches
Answer
  • all <p> elements whose class is par
  • all <p> elements whose id is par
  • all <p> elements
  • all elements whose class is par
  • all elements whose id is par

Question 2

Question
In PHP what is the data type of the variable $c? $a = 10; $b = 1.238; $c = $a * $b;
Answer
  • string
  • array
  • float
  • integer
  • boolean

Question 3

Question
In CSS, which property would be used to allow an image to be positioned on the right?
Answer
  • overflow: hidden
  • float: right
  • clear: right
  • align: right

Question 4

Question
In CSS a rule has the syntax a { b : c ; }. In this rule the symbol a is known as a
Answer
  • comment
  • parameter
  • selector
  • value
  • property

Question 5

Question
Which of the following is not a valid variable in PHP?
Answer
  • $name
  • $1name
  • $name1
  • jim
  • $_name1

Question 6

Question
In CSS the selector #p matches
Answer
  • all <p> elements whose id is p
  • all elements whose id is p
  • all <p> elements
  • all <p> elements whose class is p
  • all elements whose class is p

Question 7

Question
Considering the CSS box model, what is the final width of an element of this class: .item { width: 100px; margin: 10px; padding-left: 10px; padding-right: 0px; }
Answer
  • 100
  • 140
  • 130
  • 120
  • 150

Question 8

Question
In CSS to apply color: red to h1 and h2 you could use the rule(s)
Answer
  • h1 { color : red; } h2 { color : blue; }
  • h1 { red : color; } h2 { red : color; }
  • h1:h2 { color : red; }
  • h1, h2 { color : red; }
  • h1.h2 { color : red; }

Question 9

Question
CSS enables links to be styled differently depending on what state they are in. To set the hover colour for a link to be white, one would code a CSS rule
Answer
  • a { color : white ; hover : true ;}
  • a { hover-color : white ;}
  • a:link { color : white ; }
  • d. a:hover { color : white ; }
  • e. a { color : white ; hover-dwell : true ;}

Question 10

Question
What is the order of priority (from highest to lowest) that styles are applied to an element?
Answer
  • default html style, embedded style, inline style, externally linked style
  • externally linked style, embedded style, inline style, default html style
  • embedded style, inline style, externally linked style, default html style
  • embedded style, externally linked style, inline style, default html style
  • inline style, embedded style, externally linked style, default html style style sheet, the browser default

Question 11

Question
In PHP, what will be the output of the following code $a = "hello "; $b = "world "; $c = 10; print $a . $c . $b ;
Answer
  • hello world
  • you will get an error
  • hello 10 world
  • hello
  • 10

Question 12

Question
In CSS which property is used to control the background color?
Answer
  • bgcolor
  • background-color
  • color
  • colour
  • color-background

Question 13

Question
It is possible to define CSS in
Answer
  • only in external style sheets
  • only inline
  • only in internal style sheets
  • external style sheets, internal style sheets, and inline
  • only in external style sheets and internal style sheets

Question 14

Question
In CSS, what is the range for the R, G, B when specifying a color using rgb(R, G, B) ?
Answer
  • 1-256
  • 0-255
  • 1-100
  • 0-1
  • 0xFFFFFF

Question 15

Question
In CSS the selector p matches
Answer
  • all elements whose class is p
  • all <p> elements whose class is p
  • all <p> elements whose id is p
  • all <p> elements
  • all elements whose id is p

Question 16

Question
The background of a given HTML element can be manipulated with
Answer
  • you cannot change the background of an element
  • only background-image
  • only background-color
  • background-color, background-image

Question 17

Question
In PHP, what is the output of the following code $a = 2 + 3 * 5 + 10; print $a;
Answer
  • 20
  • 25
  • 35
  • 27
  • 50

Question 18

Question
In CSS which property is used to control the horizontal alignment of text in an element?
Answer
  • center-align
  • alignment
  • align
  • text-align
  • center

Question 19

Question
In PHP what is the value of $a $s = "Hello World"; $a = $s[7];
Answer
  • 7
  • "W"
  • "o"
  • you will get an error
  • "Hello"

Question 20

Question
In CSS, considering the CSS Box Model, would be the final width of an element with the following id? #item { width: 100px; border: 5px; margin: 5px; padding: 0px; }
Answer
  • 100
  • 0
  • 120
  • 105
  • 115

Question 21

Question
Which of the following is a valid CSS selector ?
Answer
  • p color: red
  • p color: red;
  • p { color: red; }
  • p { color red }
  • p.color { red; }

Question 22

Question
if you wanted a CSS rule to have all paragraphs of class silly to be centered on the page, which CSS rule would you use?
Answer
  • p < silly { align: center; }
  • p.silly { align: center, }
  • p.silly { text-align: center; }
  • p
  • silly { text-align: center; }

Question 23

Question
In PHP what is the data type of the variable $c? $a = 10; $b = 1.238; $c = $a * $b;
Answer
  • array
  • integer
  • string
  • boolean
  • float

Question 24

Question
The following PHP code has an error. What line is this error on? 0: $a = 10 + 1; 1: $b = "10" 2: if ($a <> $b) 3: { 4: print "Not equal"; 5: } 6: else 7: { 8: $b++; 9: }
Answer
  • 0
  • 5
  • 1
  • 4

Question 25

Question
Which of the following is the correct HTML to refer to an external style sheet style.css ?
Answer
  • <css rel="stylesheet" type="text/css" href="style.css">
  • <style> style.css</style>
  • <css> style.css</css>
  • <style "style.css\">
  • <link rel="stylesheet" type="text/css" href="style.css">

Question 26

Question
In CSS which property is used to control the size of the text?
Answer
  • text-size
  • text-style
  • font-size
  • font
  • font-style

Question 27

Question
The difference between serif and sans-serif fonts is thatThe difference between serif and sans-serif fonts is thatThe difference between serif and sans-serif fonts is thatThe difference between serif and sans-serif fonts is thatv
Answer
  • serif fonts are monospaced while sans-serif have variable width
  • sans-serif fonts have small lines at the end of some characters while serif do not
  • serif fonts have small lines at the end of some characters while sans-serif do not
  • sans-serif fonts are monospaced while serif have variable width
  • sans-serif fonts can be used without paying a royalty, while a royalty must be paid for serif fonts

Question 28

Question
In PHP, what is the output of the following code: $a = 10; $b = "10"; if ($a == $b) { print "hello "; } print "world";
Answer
  • $a
  • hello world
  • $b
  • world
  • 10

Question 29

Question
$a = "10"; $b = "20"; $c = $a * $b;
Answer
  • string
  • boolean
  • integer
  • float
  • array

Question 30

Question
What does CSS stand for?
Answer
  • Cascading Style Sheets
  • Cascading Symbols and Symptoms
  • Computer Symbol Sheets
  • Computer Style Sheets
  • CSS does not stand for anything

Question 31

Question
$a = 10; $b = 5; print '$a*$b';
Answer
  • 50
  • $a*$b
  • 10*5
  • you will get an error

Question 32

Question
$a = 10; $b = 10; print "$a * $b";
Answer
  • $a * $b
  • you will get an error
  • 100
  • 10 * 10
Show full summary Hide full summary

Similar

Computing Hardware - CPU and Memory
ollietablet123
SFDC App Builder 2
Parker Webb-Mitchell
Data Types
Jacob Sedore
Intake7 BIM L1
Stanley Chia
Software Processes
Nurul Aiman Abdu
Design Patterns
Erica Solum
CCNA Answers – CCNA Exam
Abdul Demir
Abstraction
Shannon Anderson-Rush
Spyware
Sam2
HTTPS explained with Carrier Pigeons
Shannon Anderson-Rush
Data Analytics
anelvr