1 What is the main purpose of CSS? A To create databases B To style web pages C To write logic D To connect servers
2 Where in an HTML document is the correct place to refer to an external style sheet? A In the <body> section B In the <head> section C At the end of the document D In the <footer> section
3 What does HTML stand for? A Hyper Text Markup Language B High-Level Text Machine Language C Hyperlink and Text Markup Language D Home Tool Markup Language
4 What does HTML stand for? A Hyperlinks and Text Markup Language B Hyper Text Markup Language C Home Tool Markup Language D Hyper Text Makeup Language
6 Which property is used in CSS to change the background color of an element? A color B font-color C background-color D bgcolor
7 Oliver is debugging his JavaScript code. He has a function that should return true if a number is positive, but it returns false for positive numbers. He suspects the condition is wrong. Which condition is correct for checking if a number is positive? A if (x > 0) B if (x >= 0) C if (x < 0) D if (x == 0)
8 Sam is writing JavaScript. He wants to display the current date and time on the webpage. Which built-in JavaScript object should he use? A Date B Time C DateTime D Calendar
9 Rania is debugging her CSS. She applied a style to a class, but it is not showing up on the webpage. She checks and finds another rule with higher specificity is overriding it. Which rule has higher specificity: an id selector or a class selector? A Class selector B ID selector C Both have equal specificity D Element selector
10 Leo is writing JavaScript. He needs to check if a user's age is 18 or older. He writes an if statement. Which condition should Leo use inside the parentheses? A age = 18 B age >= 18 C age > 18 D age == 18
11 Samir is designing a webpage. He wants to add a footer at the bottom with copyright information. Which HTML5 semantic tag should he use? A <footer> B <bottom> C <div id="footer"> D <foot>
12 Which of the following is primarily a client-side scripting language used to make web pages interactive? A Python B PHP C SQL D JavaScript
13 Lara is learning about CSS box model. She wants to know the space between the element and other elements. Which part of the box model is that? A Padding B Border C Margin D Content
14 Bilal is creating a CSS file for his website. He wants all paragraphs on the site to have a font size of 16px and color blue. He writes a CSS rule. Which CSS selector should Bilal use to apply these styles to all paragraph elements? A #paragraph B .para C p D *
15 Aisha is creating a link that opens in a new tab. She knows she needs to add an attribute to the <a> tag. Which attribute should she use? A target="_blank" B target="_new" C newtab="true" D open="new"
16 Wasiq is writing a CSS rule. He wants to apply a style to an element when the user clicks on it. Which pseudo-class should he use? A :hover B :focus C :active D :visited
19 What type of error occurs when a program runs without crashing but does not produce the expected or correct result? A Syntax Error B Runtime Error C Compile-time Error D Logical Error
21 Yusuf is creating a website. He wants to define a style that applies to all paragraphs with class 'highlight'. Which CSS selector should he use? A p.highlight B .highlight p C p#highlight D highlight
22 Carlos is styling a webpage. He wants to give a div a solid black border that is 2 pixels wide. Which CSS rule is correct? A border: 2px solid black; B border: solid black 2px; C border-width: 2px; border-style: solid; border-color: black; D All of the above
23 Vera is creating a website. She wants to add a paragraph and then a horizontal line to separate sections. Which HTML tag should she use for the horizontal line? A <hr> B <line> C <hline> D <separator>
25 Waleed is writing CSS. He wants to make all text in a div italic. Which CSS property should he use? A font-style: italic; B text-style: italic; C font: italic; D style: italic;