1 Emma is writing a CSS rule to center the text inside a div. She tries several properties. Which CSS property should Emma use to horizontally center the text content? A align: center B text-align: center C margin: auto D vertical-align: middle
4 Which website updates content without reloading the page? A Static website B Offline website C Dynamic website D Local website
6 What is the main purpose of CSS? A To create databases B To style web pages C To write logic D To connect servers
9 Hassan is testing his JavaScript. He has a variable named 'score' set to 10. He wants to increase the score by 5. Which line of code should he write? A score + 5; B score =+ 5; C score += 5; D score++ 5;
11 Zara is building a dynamic website. She wants to update the content of a div with id 'output' using JavaScript. Which method should she use? A document.getElementById('output').innerHTML = 'New Content'; B document.querySelector('#output').textContent = 'New Content'; C Both A and B are correct D document.write('New Content');
12 In CSS, which selector is used to style a single, unique element on a page? A Class selector (.) B Tag selector (e.g., p) C ID selector (#) D Universal selector (*)
13 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)
14 In CSS, which property is used to change the text color of an element? A font-color B color C text-color D font-style
15 Which CSS property is used to change text color? A font-style B background-color C color D text-align
16 Umar is debugging a JavaScript program that calculates the area of a rectangle. The formula is length * width. He gets NaN as output. What could be the reason? A One of the variables is a string B Variables are not defined C He used + instead of * D All of the above
17 In JavaScript, which statement is used to declare a variable? A var B let C const D All of the above
18 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
19 The process of finding and fixing errors in a program's source code is known as: A Compiling B Running C Debugging D Designing
22 Diana is working with HTML lists. She wants to create a list where each item has a bullet point. Which list type should she use? A Ordered list B Unordered list C Definition list D Nested list
23 Amina is building her first webpage and wants to add a heading that says 'Welcome to My Page'. She knows that HTML has different levels of headings. Based on HTML standards, which tag should Amina use for the main heading of her page? A <h6>Welcome to My Page</h6> B <head>Welcome to My Page</head> C <h1>Welcome to My Page</h1> D <title>Welcome to My Page</title>
25 Which error is caused by incorrect grammar of code? A Logical error B Runtime error C Syntax error D Network error