This section contains carefully selected MCQs and Previous Year Questions with explanations to help students understand concepts and prepare effectively for examinations, interviews, and competitive tests.
Q: 1Which CSS property can provide to add an effect when changing from one style to another, without using flash animations or JavaScript?
Option B
The CSS transition property allows you to add smooth effects when changing from one style to another without using flash animations or JavaScript. Transitions enhance user experience by providing visually appealing animations with minimal effort and without complex scripting.
It provides control over the duration, timing function, and delay of the change, enabling smooth gradual changes, such as fading colors, resizing elements, or moving components when a user interacts with a page.
button {
background-color: yellow;
transition: background-color 1s ease;
}
button:hover {
background-color: green;
}In this example, when the user hovers over the button, the background color smoothly changes from yellow to green in 1 seconds.
Q: 2Which of the following is NOT true about Cascading Style Sheets (CSS)?
Option D
CSS (Cascading Style Sheets) is used to control the presentation and layout of HTML documents. It separates content (HTML) from design (CSS), making web pages easier to manage and maintain.
| Statement | True / False | Explanation |
|---|---|---|
| CSS can control the layout of multiple web pages. | True | One external CSS file can be linked to many HTML pages. |
| CSS supports style formatting in HTML pages. | True | CSS is specifically designed for styling HTML elements. |
| Style definitions can be saved in an external CSS file. | True | External CSS files (.css) are commonly used. |
| Only one CSS can be used in a HTML file. | False | Multiple CSS files can be linked in one HTML document. |
CSS can be applied in three ways:
1. Inline CSS.
2. Internal CSS.
3. External CSS.
The term “Cascading” means:
Q: 3Which of the following is an advantage of using a separate CSS file in HTML?
Option D
In web development, using a separate CSS (Cascading Style Sheets) file helps in maintaining better structure and efficiency. It separates the design (CSS) from the content (HTML), which makes the code cleaner and easier to manage.
A separate CSS file allows developers to modify styles in one place, making content management easier.
It also helps in creating responsive designs for different devices like mobiles and tablets.
Additionally, CSS files are cached by the browser, which reduces server load and improves page loading speed.
You have reached the end of this topic. Continue learning with the next topic below.
Thank you so much for taking the time to read my Computer Science MCQs section carefully. Your support and interest mean a lot, and I truly appreciate you being part of this journey. Stay connected for more insights and updates! If you'd like to explore more tutorials and insights, check out my YouTube channel.
Don’t forget to subscribe and stay connected for future updates.