Q. Which is not a valid Background property of CSS ?
(A) background-image
(B) background-position
(C) background-color
(D) background-iterate
Answer:
The correct answer is (D) background-iterate. There is no CSS property called "background-iterate." The correct property for controlling the repetition of a background image is "background-repeat."
Q. What is not true about W3.CSS ?
(A) W3.CSS is a modern, responsive, mobile first CSS framework
(B) W3.CSS provides equality for all browsers
(C) W3.CSS provides equality for all devices
(D) W3.CSS is not the standard CSS
Answer:
The statement that is not true about W3.CSS is:
(D) W3.CSS is not the standard CSS.
W3.CSS is a modern, responsive, mobile-first CSS framework created by the World Wide Web Consortium (W3C). It is designed to be a standard CSS framework that provides a responsive and consistent styling experience across different devices and browsers. Therefore, option (D) is incorrect.
Q. The __________ property allows to indent the first line of text in an element.
(A) text-first
(B) text-indent
(C) first-indent
(D) text-first-indent
Answer:
The correct property that allows you to indent the first line of text in an element is:
(B) text-indent
Q. Identify the invalid HTML event.
(A) unload
(B) load
(C) onmouseout
(D) onmouseover
Answer:
(A) unload
The load event in HTML is triggered when a resource and its dependent resources (such as images and scripts) have finished loading. This event can be applied to various HTML elements, such as the entire document, images, scripts, and more.
Here's an example of using the load event on the window object to execute a function when the entire page and its associated resources have finished loading:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Load Event Example</title>
<script>
window.onload = function() {
alert("The page and all resources have finished loading.");
};
</script>
</head>
<body>
<p>This is a sample page.</p>
</body>
</html>
In this example, the window.onload event handler will be triggered when the entire page, including its resources, is fully loaded. It's commonly used to perform actions that require the complete loading of the page, such as initializing JavaScript functionality or interacting with the DOM.
The onmouseout event in HTML is triggered when the mouse pointer moves out of an element. It is often used to perform actions when the user moves the mouse away from a specific part of a webpage.
Here's an example of using the onmouseout event in HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>onmouseout Event Example</title>
<script>
function mouseOutFunction() {
alert("Mouse pointer moved out of the element!");
}
</script>
</head>
<body>
<p onmouseout="mouseOutFunction()">Move the mouse pointer out of this paragraph.</p>
</body>
</html>
In this example, the onmouseout event is attached to the <p> element, and when the mouse pointer moves out of the paragraph, the mouseOutFunction JavaScript function is executed, triggering an alert.
While this example uses the inline event handler attribute, it's generally considered better practice to use external JavaScript to attach event handlers for better separation of concerns.
The onmouseover event in HTML is triggered when the mouse pointer moves over an element. It is often used to perform actions when the user hovers the mouse over a specific part of a webpage.
Here's an example of using the onmouseover event in HTML:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>onmouseover Event Example</title>
<script>
function mouseOverFunction() {
alert("Mouse pointer moved over the element!");
}
</script>
</head>
<body>
<p onmouseover="mouseOverFunction()">Hover the mouse pointer over this paragraph.</p>
</body>
</html>
In this example, the onmouseover event is attached to the <p> element, and when the mouse pointer moves over the paragraph, the mouseOverFunction JavaScript function is executed, triggering an alert.
Similar to the onmouseout event, while this example uses the inline event handler attribute, it's generally considered better practice to use external JavaScript to attach event handlers for better separation of concerns.
Q. W3.CSS does not provides the following
border class :
(A) w3-border-top
(B) w3-border-right
(C) w3-border-bottom
(D) w3-border-gutter
Answer:
The w3-border-top class is used to add a top border to an element. When you apply this class to an HTML element, it will have a border on its top side.
The w3-border-right class is used to add a right border to an element. When you apply this class to an HTML element, it will have a border on its right side.
The w3-border-bottom class is used to add a bottom border to an element. When you apply this class to an HTML element, it will have a border on its bottom side.
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>W3.CSS Border Top Example</title>
<link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css">
</head>
<body>
<p>Before div tag</p>
<div class="w3-container w3-border-top w3-border-right w3-border-left w3-border-bottom " style="margin: 20px;">
<p>This element has a top border.</p>
</div>
<p>After div tag</p>
</body>
</html>
Q. Identify the valid new <input> tag element in HTML 5 ?
(A) email
(B) letter
(C) fax
(D) None of the above
Answer:
The valid new <input> tag element in HTML5 for capturing email input is:
(A) email
So, the correct answer is (A) email.
Q. Which tag is used to render and represents an independent piece of content of a document ?
(A) Blog
(B) Newspaper
(C) Article
(D) Record
Answer:
The tag used to render and represent an independent piece of content in a document is the:
(C) <article> tag.
Therefore, the correct answer is (C) Article.
The <article> tag in HTML is used to define a self-contained, independent piece of content within a document. This could be an article, blog post, news story, forum post, or any other piece of content that can stand alone and be syndicated or reused independently.
Here is a basic example of how the <article> tag can be used:
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Article Tag Example</title>
</head>
<body>
<article>
<h2>Introduction to HTML</h2>
<p>HTML, which stands for HyperText Markup Language, is the standard markup language for creating web pages.</p>
<p>...</p>
</article>
</body>
</html>
In this example, the <article> tag encloses content related to the introduction of HTML. The <h2> tag represents the heading of the article, and the <p> tags contain paragraphs of text within the article.
Key points about the <article> tag:
Independence: The content inside the <article> tag is intended to be independent and self-contained. It should make sense on its own and can be distributed and reused separately from the rest of the document.
Syndication: Articles marked with the <article> tag can be syndicated or distributed independently, making it easier for other websites or applications to repurpose the content.
Sections within Documents: While an article can be a complete page, it can also be a section within a larger document, such as a blog post within a website.
The <article> tag is part of the HTML5 specification and is one of the semantic elements introduced to provide more meaning and structure to web documents.
Q. Hypertext is a :
(A) Text with heavy text jargons
(B) Text more than 1000 words
(C) Text which contains links to other texts
(D) None of the above
Answer:
(C) Text which contains links to other texts
Hypertext refers to text that contains links (hyperlinks) to other texts or documents. These links allow the reader to navigate between different sections of the text or to access related information by simply clicking on the links. Hypertext is a fundamental concept on the World Wide Web, where web pages are interconnected through hyperlinks, enabling users to explore and navigate the vast amount of information available on the internet.
Q. Which comparison operator is used to find equality of type as well as content between two variables ?
(A) ==
(B) ===
(C) ====
(D) None of the above
Answer:
The comparison operator used to find equality of both type and content between two variables is:
(B) ===
The triple-equals (===) operator in JavaScript checks for both equality of value and equality of type, ensuring that both the content and the data type of the variables are the same.
Q. What is not a valid statement for Angular JS ?
(A) It is a JavaScript framework
(B) It is added using <script> tag
(C) It is a framework written in C
(D) Angular JS extends HTML attributes
Answer:
The statement that is not valid for AngularJS is:
(C) It is a framework written in C
AngularJS is a JavaScript framework, and it is not written in the C programming language. It is designed to be used with JavaScript and extends HTML attributes to make it more dynamic and interactive. The correct answer is (C).